How do i get foo.somedomain.com get handled by myapp.appspot.com/foo on appengine

非 Y 不嫁゛ 提交于 2019-12-03 16:37:18

You can't do this in the way described. In order to do this, you need to:

  1. CNAME foo.somedomain.com to ghs.google.com (not to myapp.appspot.com)
  2. Set up Google Apps for your Domain on somedomain.com, if it's not already
  3. Add the app 'myapp' to foo.somedomain.com through the Apps control panel

Once that's done, your app can check self.request.host to determine which hostname was sent, and route requests appropriately.

You can parse the sub-domain from the Host header, then call the webapp.RequestHandler appropriate for the path /[sub-domain], assuming *.yourdomain.com is directed to the Google App Engine application.

Have a look at webapp.WSGIApplication and see if there's a way to get the mapped webapp.RequestHandler for a path. Alternatively, you might be able to modify the request object to change the requested path (this I'm not sure about, however.)

This question was asked in one of the 2009 Google I/O app engine talks. Unfortunately the answer given was along the lines of not supported at this time but the possibilities of some workarounds may exist. 2009 Google I/O videos

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!