I need this feature
Users can create an account in my webapp and have their profile page under:
username.mydomain.com
(subdomain).
How can I do something like this? Where do I start?
I need this feature
Users can create an account in my webapp and have their profile page under:
username.mydomain.com
(subdomain).
How can I do something like this? Where do I start?
I wont write it all for you but here is how I've done it before:
*.yourdomain.com
-> your IP address);username.yourdomain.com
becomes yourdomain.com/username
without displaying this to the user). This SO question - Nginx convert subdomain to path component without redirect - should help you.Bonus
By default this will create a 404 - Not found
error message if a username is entered that doesn't have their own account. If you use Djangos urls (something like /users/username/
) you can return a custom User not found
or similar error message to make the user experience a bit smoother.