Question

Here is what I'd like to achieve

http://foo.somedomain.com gets handled by http://myapp.appspot.com/foo (google appengine app myapp) and the underlying url is masked.

Note the following:

  • somedomain.com is a third party domain that would like to add foo.somedomain.com
  • mydomain.com would be CNAME'd to myapp.appspot.com
  • mydomain.com/foo would point to myapp.appspot.com/foo

other scenarios

  1. can foo.mydomain.com be made to point to myapp.appsot.com/foo
  2. can foo.somedomain.com point directly to myapp.appspot.com/foo

Added: myapp.appspot.com is developed using django w/ app-engine-patch

Was it helpful?

Solution

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.

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top