RewriteRule ^olddomain.php?cat=39$ http://www.newdomain.com/firstdir/seconddir/? [R=301,NC]
RewriteRule ^olddomain.php\?cat\=39$ http://www.newdomain.com/firstdir/seconddir/? [R=301,NC]
RewriteRule ^olddomain.php?cat\=39$ http://www.newdomain.com/firstdir/seconddir/? [R=301,NC]
RewriteRule ^olddom开发者_如何学Cain.php\?cat=39$ http://www.newdomain.com/firstdir/seconddir/? [R=301,NC]
why they work??? the issue i think has something to do with the first question mark, the first equal sign, or the digits '39'...haha
Remember RewriteRule matches only your URI and it will never match the host name or query string. Here is the right way to do what you are trying to do:
Options +FollowSymlinks -MultiViews
RewriteEngine on
RewriteCond %{QUERY_STRING} ^cat=(.*)$
RewriteRule ^olddomain\.php$ http://www.newdomain.com/firstdir/seconddir/? [L,R=301,NC,NE]
精彩评论