3
votes

I have been googling a lot about this, but I can't find a specific answer to my question. I have a domain registered with a company different than Google Apps, and I would like to map all possible URLs from that domain to my App Engine app.

For instance, if a user writes www.mydomain.com/helloworld I want this request to be answered by www.myappid.appspot.com/helloworld (the URL in the address bar should remain www.mydomain.com/helloworld though). I don't care about subdomains, just the unpredictable words users might write after the .com part of the URL (e.g., www.mydomain.com/randomphrase mapping to www.myappid.appspot.com/randomphrase).

There must be a way to do it, because the Royal Wedding website was built on App Engine and they do exactly that (http://www.officialroyalwedding2011.org). They don't use subdomains for the main options of the website. For example: http://www.officialroyalwedding2011.org/tag/procession/page/1 is the URL for the procession.

Can I do this without a Google Apps domain? I did some research on CNAME records but it seems to work only for subdomains. Other questions in the website recommend reading this http://code.google.com/appengine/docs/domain.html But again, it talks about subdomains and it doesn't answer this particular question. How do I do it?

3

3 Answers

3
votes

The first line of the documentation says,

To serve your app on a custom domain, the domain must be set up with Google Apps.

But there is a way to register a domain you already own with Google Apps. See the "If you're signing up an existing domain" section here: http://www.google.com/support/a/bin/answer.py?answer=53926

1
votes

If you have your app handling URLs (i.e. someapp.appspot.com/mypage) and a custom domain name connected to the app (i.e. www.yourdomain.com for someapp.appspot.com), then the URLs should automatically be handled for your domain (i.e. requests to www.yourdomain.com/mypage will be received by the someapp.appspot.com/mypage handler).

Example: Assuming you have your custom domain name set up properly for your app (www CNAME record for ghs.google.com), requests to both http://someapp.appspot.com/ and http://www.yourdomain.com/ should be handled by the IndexRequest below.

class IndexRequest(webapp.RequestHandler):
    def get(self):
        self.response.out.write('Hello, world!')

app = webapp.WSGIApplication([
    ('/', IndexRequest),
], debug=True)

def main():
    run_wsgi_app(app)

if __name__ == '__main__':
    main()
1
votes

www is a valid subdomain of mydomain.com. Just configure your domain as described in the document you linked to, and specify www as the subdomain to map for your App Engine app.