Redirecting SUBDOMAIN to a FOLDER using MOD Rewrite
I hope someone can help me
I am trying to 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 ^F开发者_JS百科OLDER/%1/(.*) http://domain.com/newFOLDER/%1/$1 [R=301,L]
but the redirection goes to
domain.com/newFOLDER/somethinghere
can some offer help?
thanks! Mark
It should be like 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]
精彩评论