Forums

Linking multiple domains towards one app

I have two domains that I would link to one app in pythonanywhere. I have tried to use the CNAME in both of them, but only one is forwarded to my app, the other gets the "Coming Soon! This is going to be another great website...". How could I get this to work?

Each domain that's hosted by PythonAnywhere needs to have a separate web app associated with it on the "Web" tab -- so if you add one there, then it should work.

Of course, you want them to run the same code -- to do that, copy the contents of the WSGI file from one on top of the other one's, and then make sure that the other settings on the "Web" tab (static files etc) all match.

I have a similar problem... I would like both example.com and www.example.com to point to the same web app. I got the first to work, but the www subdomain get's me a "coming soon...".

Is there really no other way than to use two web apps? Maybe I'm missing some DNS trickery...

What you'd normally do on PythonAnywhere is set up www.example.com on our site, then set up what's called a "domain redirect" or "domain forwarding" with your domain name registrar so that requests to example.com get transparently redirected to www.example.com.

Check out this help page for more information, including some details on the redirection.