I want to redirect this subdomain:
http://abc.domain-name.com
to a folder on the root domain that uses the same name:
http://www.domain-name.com/abc
This way, if I try to access the following file:
http://abc.domain-name.com/folder/file.html
It will go to:
http://www.domain-name.com/abc/folder/file.html
Try this:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^subdomain\.yourdomain\.com
RewriteRule ^(.*)$ http://www\.yourdomain\.com/subdomain/$1 [L]
(from http://systembash.com/content/simple-redirect-subdomain-to-a-directory/)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With