我正在使用AppEngine部署静态网站,并且在多次尝试使处理程序的顺序正确之后,我的app.yaml文件现在从网址中删除文件扩展名,同时还显示所有css,js,图像和其他静态资源如果你的处理程序顺序错误,则不会。
***但是,出于某种原因,浏览时只有部分静态页面可以正常工作。其他人返回404。
文件结构:
根
www(目录)
我的app.yaml如下:
runtime: python27
api_version: 1
threadsafe: true
#With the following handler order, .html is removed from urls and all static resources load fine.
#However, some static pages throw a 404, even though they're in same directory as those that work.
handlers:
- url: /(.*)
static_files: www/\1
upload: www/(.*)
secure: always
- url: /
static_files: www/index.html
upload: www/index.html
secure: always
- url: /(.+)
mime_type: text/html
static_files: www/\1.html
upload: www/(.+)
secure: always