views:

46

answers:

1

I have a login required page at:

http://site1.example.com/widget/52312

If I email someone that link for them to click on, they get sent to the Login prompt. But after they login they end up going to http://example.com/widget/52312. How do you keep the subdomain in the site preserved when a user gets prompted through a login process?

NOTE: The 'site1' is specific to the logged in user and not set for the whole machine in Apache. Each user has their own subdomain, but the links they are clicking on DO include their specific subdomain.

+1  A: 

I think this probably happens for the same reasons as those given in answer to http://stackoverflow.com/questions/1457006/djangos-httpresponseredirect-seems-to-strip-off-my-subdomain

Make sure your web server has its servername set correctly (e.g. Apache ServerName directive) i.e. set to site1.example.com. If this is OK, see: http://thingsilearned.com/2009/01/05/using-subdomains-in-django/ - although I have a Django site with logins hosted on a subdomain working quite happily without the need for that middleware.

msanders
The sub-domains change for each user.
MikeN