Selective redirect to new domain
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.
精彩评论