我刚刚将几个静态网站移至Google的App Engine,如果您想使用自己的域名,则需要使用www子域名。这两个域的路由都是正确的,除了一个完整的url路径不会传递给子域,除非在链接中输入了www或者存在于该域中;没有www,页面重定向回家。Google App Engine网址路径与www子域名丢失
工作站点或者链接将工作:
http://www.synth.tk/daw/
http://synth.tk/daw/
问题的站点只有第一个链接将工作;第二重定向到主页:
http://www.carolyncaton.com/photos/
http://carolyncaton.com/photos/
两个域设置为使用以下的主机记录按谷歌的指示FreeDNS:
@ | A | 216.239.32.21
@ | A | 216.239.34.21
@ | A | 216.239.36.21
@ | A | 216.239.38.21
www | CNAME | ghs.google.com
无一不是使用以下app.yaml
文件:
application: app-name-here
version: 1
runtime: python
api_version: 1
default_expiration: "30d"
handlers:
- url: /(.*\.css)
mime_type: text/css
static_files: static/\1
upload: static/(.*\.css)
- url: /(.*\.html)
mime_type: text/html
static_files: static/\1
upload: static/(.*\.html)
expiration: "1h"
- url: /(.*\.js)
mime_type: text/javascript
static_files: static/\1
upload: static/(.*\.js)
- url: /(.*\.eot)
mime_type: application/vnd.ms-fontobject
static_files: static/\1
upload: static/(.*\.eot)
- url: /(.*\.(svg|svgz))
mime_type: images/svg+xml
static_files: static/\1
upload: static/(.*\.(svg|svgz))
- url: /(.*\.ttf)
mime_type: font/truetype
static_files: static/\1
upload: static/(.*\.ttf)
- url: /(.*\.woff)
mime_type: application/x-font-woff
static_files: static/\1
upload: static/(.*\.woff)
- url: /(.*\.pdf)
mime_type: application/pdf
static_files: static/\1
upload: static/(.*\.pdf)
# image files
- url: /(.*\.(bmp|gif|ico|jpeg|jpg|png))
static_files: static/\1
upload: static/(.*\.(bmp|gif|ico|jpeg|jpg|png))
# index files
- url: /(.+)/
static_files: static/\1/index.html
upload: static/(.+)/index.html
expiration: "15m"
- url: /(.+)
static_files: static/\1/index.html
upload: static/(.+)/index.html
expiration: "15m"
# site root
- url:/
static_files: static/index.html
upload: static/index.html
expiration: "15m"
我在想也许你没有完全阅读我的文章。再看一次。问题是,为什么一个人正确地转发到www,而另一个未能通过完整的url路径。 – Mica 2012-03-07 16:01:13