开发者

Redirecting SUBDOMAIN to a FOLDER using MOD Rewrite

开发者 https://www.devze.com 2023-03-04 19:55 出处:网络
I hope someone can help me I am trying to redirect NON www traffic requests from USER.domain.com/FOLDER/somethinghere

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

精彩评论

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