2012-03-07 49 views
2

我刚刚将几个静态网站移至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" 

回答

0

这两个网站似乎现在工作。也许只是需要一段时间才能传播域名服务器更新。

+0

他们都在一直工作,只是一个人重定向到主页,除非有www,而另一个则带你到没有www的正确的地方。 – Mica 2012-03-09 04:53:36

+0

对不起,我不明白这个问题。在SO上“碰撞”问题的典型方式是发布赏金,或者让你的问题得到满足。我不知道你的问题的答案,但你有没有检查,看到DNS条目都完全一样?工作案例中是否有额外的CNAME条目或其他重定向? – dragonx 2012-03-11 02:17:55

+0

您是否使用Google Apps域设置重定向?肯定会有一些可怕的事情发生,你会在carolyncaton.com上获得不同的重定向(302)。我会尝试使用Google Apps域设置,可能会删除映射并将其添加回来。 – dragonx 2012-04-10 16:47:58

1

在Chrome中使用开发者控制台(F12,点击“保存日志导航”按钮),你可以看到http://carolyncaton.com/photos/得到302响应http://www.carolyncaton.com/。由于App Engine不支持裸(顶点)域,因此问题必须在其他位置。我建议你检查FreeDNS的设置,如“保存路径”。

+0

工作案例给出了301重定向到正确的文件(/ daw),失败的案例给出了302重定向到基础url(/)。我不确定您的A作业中是否有任何设置会影响此设置。 – dragonx 2012-04-10 16:27:18