用一些php文件在GAE上托管一个主要是静态的网站
我在Google App Engine上托管了一个大部分是静态的网站,在设置App.yaml时遇到了一些问题。不是这样就是我的文件路径关闭了。我看到过其他帖子,其中混合静态和动态内容似乎会带来一些麻烦,因此我决定将我的文件设置为:用一些php文件在GAE上托管一个主要是静态的网站,php,html,google-app-engine,filepath,app.yaml,Php,Html,Google App Engine,Filepath,App.yaml,我在Google App Engine上托管了一个大部分是静态的网站,在设置App.yaml时遇到了一些问题。不是这样就是我的文件路径关闭了。我看到过其他帖子,其中混合静态和动态内容似乎会带来一些麻烦,因此我决定将我的文件设置为: Site (Root Folder) app.yaml contact (Dynamic page) -index.php projects (Nothing in here yet but will group dynamic
Site (Root Folder)
app.yaml
contact (Dynamic page)
-index.php
projects (Nothing in here yet but will group dynamic content here)
README.md
www (Static files)
-blog
-css
-images
-index.html
-js
正在尝试在我的主页上创建链接
/www/index.html
/contact/index.php
到我的联系人页面
/www/index.html
/contact/index.php
应该引导您从index.html到index.php的文件路径是
../contact/index.php
下面是我的app.yaml
runtime: php55
api_version: 1
handlers:
- url: /
static_files: www/index.html
upload: www/index.html
mime_type: home
secure: always
- url: /(.*)
static_files: www/\1
upload: www/(.*)
secure: always
application_readable: true
- url: contact/index.php
script: /contact/index.php
secure: always
不知道我做错了什么。我尝试了几种不同的文件路径,但根本无法显示页面。当我点击应该带我去联系人页面(index.php)的链接时,我得到一个404错误。您的通配符捕获所有处理程序在到达正确的处理程序之前正在抓取
联系人/index.php
。另外,您缺少前导斜杠<代码>mimetype:home不正确。试试这个:
runtime: php55
api_version: 1
handlers:
- url: /contact/index.php
script: /contact/index.php
secure: always
- url: /
static_files: www/index.html
upload: www/index.html
secure: always
- url: /(.*)
static_files: www/\1
upload: www/(.*)
secure: always
application_readable: true
您的通配符catch all处理程序正在抓取
contact/index.php
,然后才能找到合适的处理程序。另外,您缺少前导斜杠<代码>mimetype:home不正确。试试这个:
runtime: php55
api_version: 1
handlers:
- url: /contact/index.php
script: /contact/index.php
secure: always
- url: /
static_files: www/index.html
upload: www/index.html
secure: always
- url: /(.*)
static_files: www/\1
upload: www/(.*)
secure: always
application_readable: true
我最终在yaml中添加了一些项目,但效果不错!我很高兴ahaI最终在yaml中添加了项目,但这起作用了!我很高兴啊哈