Template for building a multi domain web host on the Google App Engine platform.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
www.exampledomain1.com/html
www.exampledomain2.com/html
README.md
app.yaml
index.yaml
main.py
utils.py

README.md

multi-domain-appengine

Template for hosting multiple domains on a single Google App Engine instance.

All the magic happens in the route entries inside app.yaml. For example:

routes.DomainRoute('<domain name>', [
	webapp2.Route('/<path:.*?>', handler=MainHandler,  name='<root directory>')
])

Simply replace '<domain name>' with the name of the domain you wish to catch and set '<root directory>' to the root directory of the matching website.

Make sure that you add your domain to your Google account by going to 'Application Settings' in the App Engine dashboard and clicking 'Add Domain'. Also make sure that you point your DNS entries to Google's servers by adding a CNAME entry to "ghs.googlehosted.com".

Also, as the files are not being served through the App Engine 'static' handler which is designed to serve static files but actually through your application, I recommend a caching proxy such as CloudFlare so that your server gets less hammered.