Forums

4th level domains

I have established a custom domain pointing to my PA account: "myapp.mycompany.com" Now I want to give users their own subdomain (just like PA does) but I'm already 3 deep. So I would have to go to 4th-level, for example, jack.myapp.mycompany.com and jill.myapp.mycompany.com

a) Is this supported? and b) is there a mod_rewrite type of module that will allow Flask or Bottle to interpret these as myapp.mycompany.com/jack/ ? Because I think their routing only natively supports what comes after the ".com". (I could be wrong here)

And SSL will be a must, so that probably complicates things further.

I read: https://www.pythonanywhere.com/forums/topic/1391/ but the latest reply is a year old.

Thank you.

Fourth-level domains are supported but unfortunately our setup for per-user domains on your site isn't very good right now -- you need to add a web app in the "Web" tab for each one, which is likely to become prohibitively expensive quite quickly :-(

Not just expensive, but each web app has its own file directory, each of which would need to contain the identical code (or use some kind of redirect that maintained the user's identity). :-( is right

It's not quite that bad -- different web apps can share the same code and database, so that side of it would be OK. And in theory you could look at the "Host" header in each request (perhaps using custom WSGI code or Django middleware or similar) so that each request would know which user it was meant to deal with.

But the cost thing is a problem. We did an experiment a while back to see if we could handle multiple domains for one web app and it did work, but it would require quite a few changes. Definitely something that's on the list, but I can't promise if an when it will get done.