regex - htaccess rewrite - redirect subdomain to directory for any domain -


i need coming correct .htaccess rule. there sort of variable allows 'brand1' , work correctly? if not, have have separate rewrite rule brand1, brand2, brand3, brand4, etc. same domain. there variable allow rule work domain entered browser? i'd prefer have 1 rewrite rule can handle brand , domain if possible, rather separate rule specifying each brand , each domain. magento multistore setup.

rewritecond %{http_host} ^brand1\.domain\.com$ rewriterule (.*) http://www.domain.com/brand1/$1 [p] 

any can provide appreciated! thanks!

you can use:

rewritecond %{http_host} ^([^.]+)\.domain\.com$ rewriterule (.*) http://www.domain.com/%1/$1 [l,p] 

Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -