.htaccess - Redirecting SUBDOMAIN to a FOLDER using MOD Rewrite -
i hope can me
i trying redirect non www traffic requests from
user.domain.com/folder/somethinghere
to
domain.com/newfolder/user/somethinghere
i tried
rewritecond %{http_host} (.*).domain.com rewriterule ^folder/%1/(.*) http://domain.com/newfolder/%1/$1 [r=301,l]
but redirection goes to
domain.com/newfolder/somethinghere
can offer help?
thanks! mark
it should this:
rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewritecond %{http_host} ^(.*)\.domain\.com$ [nc] rewriterule ^folder/(.*)$ http://domain.com/newfolder/%1/$1 [r=301,l,nc]
Comments
Post a Comment