Forums

custom domain question / CNAME

I recently set up a web app at www.mysite.com , of course I accomplished this by setting the CNAME record for www.mysite.com to refer to myname.pythonanywhere.com

Therefore, I am curious why the site does not work when I go directly to myname.pythonanywhere.com , instead I get a landing page message. Thanks.

The way we route requests is by looking at the request headers, including what host the user has asked for. The CNAME gets people to us, but the original request is what we look at. So your request for www.mysite.com goes to the app you've set up for it, but if you request yourname.pythonanywhere.com, that's what the original request still says, and if you don't have a web app set up for that, we don't know where to route it to.

This is why we can support multiple web apps on different domains, all using the same DNS/CNAME setup.