繁体   English   中英

htaccess从网址中删除特定的查询字符串

[英]htaccess to remove specific query string from url

我有网址

http://example.com/index.php?err=true&i=1

i值将1更改为3。我想将该URL转换为:

http://example.com/index.php?err=true 

只要在URL中找到查询字符串参数i ,就必须从URL中删除i

您可以使用此规则从任意位置的查询字符串中删除参数i

RewriteEngine On

RewriteCond %{THE_REQUEST} \?(.*&)?i=[^&]*&?(\S*)\sHTTP [NC]
RewriteRule ^ %{REQUEST_URI}?%1%2 [R=308,NE,L]

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM