Apache 重定向除?p之外的所有内容=*
如何配置.htaccess文件以重定向除Apache 重定向除?p之外的所有内容=*,apache,.htaccess,mod-rewrite,redirect,seo,Apache,.htaccess,Mod Rewrite,Redirect,Seo,如何配置.htaccess文件以重定向除 domain.com?p=* 及 到domain.com 我希望你能理解我的问题,谢谢你的每一个回答。 来自德国的问候语。将其放入文档根目录的htaccess文件中: RewriteEngine On # if query string is p=(something) RewriteCond %{QUERY_STRING} ^p= # and request is for "/" or "/index.php" RewriteCond %{REQU
domain.com?p=*
及
到domain.com
我希望你能理解我的问题,谢谢你的每一个回答。
来自德国的问候语。将其放入文档根目录的htaccess文件中:
RewriteEngine On
# if query string is p=(something)
RewriteCond %{QUERY_STRING} ^p=
# and request is for "/" or "/index.php"
RewriteCond %{REQUEST_URI} ^/$ [OR]
RewriteCond %{REQUEST_URI} ^/index\.php$
# pass it through, don't do anything
RewriteRule ^ - [L]
# otherwise, redirect everything else to http://domain.com/
RewriteRule ^ http://domain.com/ [L,R=301]
RewriteEngine On
# if query string is p=(something)
RewriteCond %{QUERY_STRING} ^p=
# and request is for "/" or "/index.php"
RewriteCond %{REQUEST_URI} ^/$ [OR]
RewriteCond %{REQUEST_URI} ^/index\.php$
# pass it through, don't do anything
RewriteRule ^ - [L]
# otherwise, redirect everything else to http://domain.com/
RewriteRule ^ http://domain.com/ [L,R=301]