Forums

Is it possible to have PA sub-domain and custom domain point to the same page?

Hi there,

New paid PA user here. I currently just have one app and have a custom domain set up. That link is working fine, but my username.pythonanywhere.com is pointing to the generic python anywhere page ("Coming Soon!"). Is this the normal behavior? Is there a way have both of my username.pythonanywhere.com and my own domain point to the same place? Thank you.

Thanks for upgrading to a paid account!

With the account you have right now, you can only have one web app; the custom domain you have set up is that one. If you upgrade to an account with two web apps ($2/month more for your type of account), then you can fairly easily set things up so that they both have the same contents:

  • Create a new web app with the username.pythonanywhere.com domain -- just choose the "Manual configuration" option, and the version of Python that your custom domain is currently showing.
  • Once that's created (and showing a "hello, world" kind of page), go to your custom domain on the "Web" tab
  • Go to the WSGI file for your custom domain (it's linked on the page for that domain)
  • Copy all of the contents.
  • Go back to the Web tab, and select your username.pythonanywhere.com domain.
  • Go to its WSGI file
  • Paste the stuff you got from the custom domain's one, completely replacing the existing contents, then save.
  • Go back to the "Web" tab.
  • Make the other settings on that tab (eg. virtualenv and static file settings) on the username.pythonanywhere.com domain match the ones on the custom domain's page.
  • Reload the username.pythonanywhere.com domain

...and you're done. Any code changes you make will be reflected on both domains.

Perfect!

Glad to help :-)