0
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 ^olddomain.php\?cat=39$ http://www.newdomain.com/firstdir/seconddir/? [R=301,NC]

なぜ彼らは働くのですか?問題は、最初の疑問符、最初の等号、または数字の「39」に関係があると思います...笑

4

1 に答える 1

1

RewriteRule は URI のみに一致し、ホスト名やクエリ文字列には一致しないことに注意してください。あなたがやろうとしていることを行う正しい方法は次のとおりです。

Options +FollowSymlinks -MultiViews
RewriteEngine on

RewriteCond %{QUERY_STRING} ^cat=(.*)$
RewriteRule ^olddomain\.php$ http://www.newdomain.com/firstdir/seconddir/? [L,R=301,NC,NE]
于 2011-05-03T18:25:20.697 に答える