我有网址
http://example.com/index.php?err=true&i=1
i
值更改为1到3.我想将该网址转换为:
http://example.com/index.php?err=true
每当在网址中找到查询字符串参数i
时,必须从网址中删除i
。
答案 0 :(得分:0)
您可以使用此规则从任意位置从查询字符串中删除参数i
:
RewriteEngine On
RewriteCond %{THE_REQUEST} \?(.*&)?i=[^&]*&?(\S*)\sHTTP [NC]
RewriteRule ^ %{REQUEST_URI}?%1%2 [R=308,NE,L]