AppEngine: browsing (only some) static html files return 404 error

151 views Asked by At

I'm deploying a static site using AppEngine and after many attempts to get the order of handlers correct, my app.yaml file now removes file extensions from urls while also displaying all css, js, images and other static resources which it doesn't if you get the handler order wrong.

***However, for some reason, only some of my static pages work when browsing. The others return a 404.

File structure:

Root

  • app.yaml
  • www (directory)

    • index.html: WORKS
    • page2.html: WORKS
    • page3.html: WORKS
    • (all others).html DON'T WORK
    • css
    • js
    • images
    • etc

My app.yaml is as follows:

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

There are 0 answers