开发者

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]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜