开发者

Selective redirect to new domain

开发者 https://www.devze.com 2023-02-06 05:46 出处:网络
I am using this for redirecting all my request through index.php except select few. RewriteEngine on RewriteCond $1 !^(index\\.php|olddir|smestuff|assets|robots\\.txt)

I am using this for redirecting all my request through index.php except select few.

RewriteEngine on
RewriteCond $1 !^(index\.php|olddir|smestuff|assets|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]

I want to shift few things (directories) to new domain, so I want to know how can I redirect olddir|smestuff (//from above example) to new domain开发者_JAVA技巧 and keep everything else safe


You already don't redirect olddir and smestuff, so add:

RewriteCond $1 ^(olddir|smestuff)
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R,L]

which will cause a browser redirect to the new domain.

0

精彩评论

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