Answer the question
In order to leave comments, you need to log in
.htaccess rewrite subdomain to directory?
Is it possible to use .htaccess to rewrite a subdomain into a directory?
Example: sub.domain.com shows content domain.com/subdomains/sub
rewritten to .htaccess but doesn't work
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(.*)\.domain\.com
RewriteRule ^(.*)$ http://domain.com/subdomains/%1/$1 [L,NC,QSA]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question