Php 如何重定向301错误url?
我的url不正确:Php 如何重定向301错误url?,php,.htaccess,Php,.htaccess,我的url不正确: http://mypage.org/first/second/?one=two&three=3&44=1 我想把这个重定向到: http://mypage.org 但在htaccess中: Redirect 301 /first/second/?one=two&three=3&44=1 http://mypage.org 不工作。例如: Redirect 301 /first/second http://mypage.org 工作正常。
http://mypage.org/first/second/?one=two&three=3&44=1
我想把这个重定向到:
http://mypage.org
但在htaccess中:
Redirect 301 /first/second/?one=two&three=3&44=1 http://mypage.org
不工作。例如:
Redirect 301 /first/second http://mypage.org
工作正常。您可以使用
mod\u rewrite
RewriteEngine On
RewriteCond %{QUERY_STRING} ^one=two&three=3&44=1$ [NC]
RewriteRule ^first/second/$ /? [R=301,L]