views:

693

answers:

3

Hi,

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

A: 

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.)

Blixt
+1  A: 

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.

Nick Johnson
Since somedomain is "not" mydomain, would requesting somedomain to setup google apps for their domain affect their existing website and access in any way? If for example somedomain were to be asuccesful blog/publisher who currently does not use google apps would this add any constraints ??
molicule
No, they only have to map the subdomains they want to.
Nick Johnson
A: 

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

Jason Rikard