AppEngine:浏览(只有一些)静态html文件返回404错误

时间:2017-09-27 17:11:43

标签: google-app-engine handlers app.yaml

我正在使用AppEngine部署静态网站,并且在多次尝试使处理程序的顺序正确之后,我的app.yaml文件现在从网址中删除文件扩展名,同时还显示所有css,js,图像和其他静态资源如果你的处理程序顺序错误,则不会。

***但是,出于某种原因,浏览时只有部分静态页面可以正常工作。其他人返回404。

文件结构:

  • 的app.yaml
  • www(目录)

    • index.html:WORKS
    • page2.html:WORKS
    • page3.html:WORKS
    • (所有其他人).html不要工作
    • CSS
    • JS​​
    • 图像

我的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

0 个答案:

没有答案