[英]help htaccess isapi rewrite
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”有关……哈哈
记住 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]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.