I want to rewrite url to for two subdomains in .htaccess
domain1.test.com
-> domain1.test.com/test1
domain2.test.com
-> domain2.test.com/test2
.
Whats the proper to achieve it?
One way to do it would be:
RewriteCond %{HTTP_HOST} ^domain1.test.com$ [NC]
RewriteRule ^(.*)$ test1/$1 [NC,L]
RewriteCond %{HTTP_HOST} ^domain2.test.com$ [NC]
RewriteRule ^(.*)$ test2/$1 [NC,L]