I have deploy my website through the tutorials using Google App Engine.
My website is work now.
However, it's only works on https://koki-6hats.appspot.com/index.html
For other cases like:
https://koki-6hats.appspot.com/index
https://koki-6hats.appspot.com/
https://koki-6hats.appspot.com/shouldGoToIndex.html
is not worked.
How can I config the routing rule to make sure all links above can redirect to index.html automatically?
My app.yaml:
env: flex
runtime: php
runtime_config:
document_root: .
I found that there are some method using standard environment to do the static redirection. But when I tried to use that approach, my index.html breaks and remain black text and white background only.
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/(.*)
Moreover, it is important to keep the folder hierarchy as recommended in the documentation, all folders below the 'www' folder.--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/f4928cd5-0b92-4bf8-ae7b-1508200b34cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
runtime: python27api_version: 1threadsafe: true
default_expiration: "3m"
handlers:- url: /(.*\.(appcache|manifest)) mime_type: text/cache-manifest static_files: static/\1 upload: static/(.*\.(appcache|manifest))
- url: /(.*\.atom) mime_type: application/atom+xml static_files: static/\1 upload: static/(.*\.atom)
- url: /(.*\.crx) mime_type: application/x-chrome-extension static_files: static/\1 upload: static/(.*\.crx)
- url: /(.*\.css) mime_type: text/css static_files: static/\1 upload: static/(.*\.css)
- url: /(.*\.eot) mime_type: application/vnd.ms-fontobject static_files: static/\1 upload: static/(.*\.eot)
- url: /(.*\.htc) mime_type: text/x-component static_files: static/\1 upload: static/(.*\.htc)
- url: /(.*\.html) mime_type: text/html static_files: static/\1 upload: static/(.*\.html)
- url: /(.*\.ico) mime_type: image/x-icon static_files: static/\1 upload: static/(.*\.ico)
- url: /(.*\.js) mime_type: text/javascript static_files: static/\1 upload: static/(.*\.js)
- url: /(.*\.json) mime_type: application/json static_files: static/\1 upload: static/(.*\.json)
- url: /(.*\.m4v) mime_type: video/m4v static_files: static/\1 upload: static/(.*\.m4v)
- url: /(.*\.mp4) mime_type: video/mp4 static_files: static/\1 upload: static/(.*\.mp4)
- url: /(.*\.(ogg|oga)) mime_type: audio/ogg static_files: static/\1 upload: static/(.*\.(ogg|oga))
- url: /(.*\.ogv) mime_type: video/ogg static_files: static/\1 upload: static/(.*\.ogv)
- url: /(.*\.otf) mime_type: font/opentype static_files: static/\1 upload: static/(.*\.otf)
- url: /(.*\.rss) mime_type: application/rss+xml static_files: static/\1 upload: static/(.*\.rss)
- url: /(.*\.safariextz) mime_type: application/octet-stream static_files: static/\1 upload: static/(.*\.safariextz)
- url: /(.*\.(svg|svgz)) mime_type: images/svg+xml static_files: static/\1 upload: static/(.*\.(svg|svgz))
- url: /(.*\.swf) mime_type: application/x-shockwave-flash static_files: static/\1 upload: static/(.*\.swf)
- url: /(.*\.ttf) mime_type: font/truetype static_files: static/\1 upload: static/(.*\.ttf)
- url: /(.*\.txt) mime_type: text/plain static_files: static/\1 upload: static/(.*\.txt)
- url: /(.*\.unity3d) mime_type: application/vnd.unity static_files: static/\1 upload: static/(.*\.unity3d)
- url: /(.*\.webm) mime_type: video/webm static_files: static/\1 upload: static/(.*\.webm)
- url: /(.*\.webp) mime_type: image/webp static_files: static/\1 upload: static/(.*\.webp)
- url: /(.*\.woff) mime_type: application/x-font-woff static_files: static/\1 upload: static/(.*\.woff)
- url: /(.*\.xml) mime_type: application/xml static_files: static/\1 upload: static/(.*\.xml)
- url: /(.*\.xpi) mime_type: application/x-xpinstall static_files: static/\1 upload: static/(.*\.xpi)
# image files- url: /(.*\.(bmp|gif|ico|jpeg|jpg|png)) static_files: static/\1 upload: static/(.*\.(bmp|gif|ico|jpeg|jpg|png))
# audio files- url: /(.*\.(mid|midi|mp3|wav)) static_files: static/\1 upload: static/(.*\.(mid|midi|mp3|wav))
# windows files- url: /(.*\.(doc|exe|ppt|rtf|xls)) static_files: static/\1 upload: static/(.*\.(doc|exe|ppt|rtf|xls))
# compressed files- url: /(.*\.(bz2|gz|rar|tar|tgz|zip)) static_files: static/\1 upload: static/(.*\.(bz2|gz|rar|tar|tgz|zip))
# index files- url: /(.*) static_files: static/index.html upload: static/index.html
# site root- url: / static_files: static/index.html upload: static/index.html
As per [1] the app.yaml should be like this:
- url: /
static_files: www/index.html
upload: www/index.html
- url: /folderA/(.*)
static_files: folderA/index.html
upload: folderA/index.html
- url: /folderB/(.*)
static_files: folderB/index.html
upload: folderB/index.html
- url: /folderA
static_files: folderA/index.html
upload: folderA/index.html
- url: /folderB
static_files: folderB/index.html
upload: folderB/index.html
- url: /(.*)
static_files: www/index.html
upload: www/index.html