GAE Angular 2 static app , how to configure app.yaml to redirect 404 errors to index.html

327 views
Skip to first unread message

Chanky Mallick

unread,
Oct 18, 2018, 9:10:20 AM10/18/18
to Google App Engine

Need to redirect all 404 links to index.html inside www folder

This is my app.yaml

runtime: python27
api_version: 1
threadsafe: true

handlers:
- url: /
  static_files: www/index.html
  upload: www/index.html

- url: /(.*)
  static_files: www/\1
  upload: www/(.*)

It's a static angular 2 app , and i need to direct all page not found 404 errors to index.html. There is (www) folder and inside that all file including index.html there.


https://stackoverflow.com/questions/52856895/how-to-configure-google-app-engine-yaml-file-to-handle-404-error

Aref Amiri (Cloud Platform Support)

unread,
Oct 18, 2018, 5:29:57 PM10/18/18
to Google App Engine

For this case, you can use the answer that was posted on the Stackoverflow. I noticed you have already tried it and accepted as the best answer. The other option is to use Error handlers in your app.yaml.


Reply all
Reply to author
Forward
0 new messages