mod rewrite - Subdomain URL Rewriting and Web Apps -


In many web apps, customers choose their own subdomain, i.e. mycompany.webapp.com

Probably, each subdomain works from a single set of files and unique subdomains are probably stored as a session object. How does the URL rewrite work?

If someone goes to my company.webp.com, then you have to re-type their unique address on the dynamic page, meaning webapp.com/mypage.php, to set session variables? Cusomer = mycompany

But when you are redirected, you will be at webapp.com/theappdirectory/ and mycompany.webapp.com /

How do they do it?

The PS IIS is running but the method should be similar to any server. The big deal for us is that we can not do webapp.com/theappdirectory/mycompany/somefile.html, meaning that all the files live in a directory and we have to set a session variable while masking the subdomain.

Post-text "itemprop =" text "^ /] +) \. Example \ .com $ RewriteCond% 1! = Www RewriteRule ^ mypage.php? Customer =% 1

This work needs to be configured to accept all the subdomains your server / virtual host needs (see for example).


Comments