1. 云栖社区>
  2. PHP教程>
  3. 正文

Google App Engine PHP requests seem to always go to the catch all handler

作者:用户 来源:互联网 时间:2017-12-01 17:06:17

Google App Engine PHP requests seem to always go to the catch all handler - 摘要: 本文讲的是Google App Engine PHP requests seem to always go to the catch all handler, Question: I am new to google app engine and am using PHP to create a website for a project on google app engine. The we

Question:

I am new to google app engine and am using PHP to create a website for a project on google app engine. The website will need to have multiple files. At the moment I am able to go on one page and when I click the ‘contact’ link to go to the contact page, the page still says the same and doesn’t change.

My app.yaml handlers are:

handlers:

- url: / ( . * /. ( gif | png | jpg | ico | js | css ) )

static_files: / 1

upload: ( . * /. ( gif | png | jpg | ico | js | css ) )

- url: / . *

script: mainpage.php    

- url: / contact.php    

script: contact.php

So I can go to mainpage.php and when I click on the ‘contact’ link, the URL chances to ****.appspot.com/contact.php. But the page doesn’t actually change to ‘contact.php’

Answer:

Invert your handlers. The way handlers work is that it looks top to bottom, as soon as there’s ONE match, it returns that.

So if your first handler is a catch all, there is no way to go to the second one Google App Engine PHP requests seem to always go to the catch all handler

Via: http://stackoverflow.com//questions/28774344/google-app-engine-php-requests-seem-to-always-go-to-the-catch-all-handler

以上是云栖社区小编为您精心准备的的内容,在云栖社区的博客、问答、公众号、人物、课程等栏目也有的相关内容,欢迎继续使用右上角搜索按钮进行搜索,以便于您获取更多的相关知识。

弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率

40+云计算产品,6个月免费体验

现在注册,免费体验40+云产品,及域名优惠!

云服务器9.9元/月,大学必备