Subdomain URL Rewriting and Web Apps

Posted by Igor K on Stack Overflow See other posts from Stack Overflow or by Igor K
Published on 2010-05-16T13:54:25Z Indexed on 2010/05/16 14:00 UTC
Read the original article Hit count: 352

So a lot of web apps have the customer choose their own subdomain, ie mycompany.webapp.com

Presumably, every subdomain works off the same set of files and the unique subdomain is perhaps stored as a session object. So how does the URL rewriting work?

If someone goes to mycompany.webapp.com, you have to rewrite their unique address to a dynamic page to set the session variable, ie webapp.com/mypage.php?cusomer=mycompany

But then when you redirected, you'd be at webapp.com/theappdirectory/ and not mycompany.webapp.com/

So how do they do it?

© Stack Overflow or respective owner

Related posts about mod-rewrite

Related posts about url-rewriting