.htaccess htaccess更改查询字符串名称&;价值

.htaccess htaccess更改查询字符串名称&;价值,.htaccess,mod-rewrite,.htaccess,Mod Rewrite,我一直在试图弄清楚这一点有一段时间了,似乎不能得出一个总是有效的结论 我只需要替换查询字符串名称,请参见: index.php?option=com_hikashop&ctrl=checkout&task=notify%C2%ACif_payment=bf_rbsbusinessgateway&componentStyle=common 我们得到了上面的部分,这是我需要操作的部分。有更多的查询字符串附加在5-10个依赖项上 我只需要更改部分: task=notify%C

我一直在试图弄清楚这一点有一段时间了,似乎不能得出一个总是有效的结论

我只需要替换查询字符串名称,请参见:

index.php?option=com_hikashop&ctrl=checkout&task=notify%C2%ACif_payment=bf_rbsbusinessgateway&componentStyle=common
我们得到了上面的部分,这是我需要操作的部分。有更多的查询字符串附加在5-10个依赖项上

我只需要更改部分:

task=notify%C2%ACif_payment
致:


任何mod rewrite专家都能提供解决方案吗?

您可以将此规则用作站点根目录中的第一条规则。htaccess:

RewriteCond %{THE_REQUEST} \?(.*&)?(task=notify)\%C2\%AC(if_payment)&?(\S*)\sHTTP [NC]
RewriteRule ^index\.php$ %{REQUEST_URI}?%1%2&not%3%4 [R=301,NE,L]
在测试此更改之前,请确保清除浏览器缓存

RewriteCond %{THE_REQUEST} \?(.*&)?(task=notify)\%C2\%AC(if_payment)&?(\S*)\sHTTP [NC]
RewriteRule ^index\.php$ %{REQUEST_URI}?%1%2&not%3%4 [R=301,NE,L]