i just want to ask a quick question about .htaccess.
Here’s how my webhosting works with subdomains…
Once i create a subdomain… then they create a folder into the root folder like this…
www.mydomain.com ---> public_html
sub.mydomain.com ---> public_html/sub
What i want to do is… to redirect all request from sub.mydomain.com to http://www.mydomain.com with some GET variable or something to identify from what subdomain the request is coming from…
So for example… when i get a requests to work like this
http://sub.mydomain.com/myphp.php ---> http://www.mydomain.com/myphp.php?comingfrom=sub
http://sub.mydomain.com/(anyUrl) ---> http://www.mydomain.com/(anyUrl)?comingfrom=sub
I’m also wondering if this would execute some .htaccess redirects present in the main domain…
Hope you guys could help me…
Thanks in advance…
Put a .htaccess with following content into your subdomain folders:
(untested, sorry)
EDIT:
you pointed out that you would like to keep the subdomain in your addressbar and don’t want a redirect. So you need to make a view changes to your
<VirtualHost>of http://www.mydomain.com like so