在查询字符串的开头有一个以"&“开头的URL。
www.example.com/index.htm?¶meter1=value1¶meter2=value2我希望将以&开头的查询字符串重定向到相同的URL,但在开始时不使用&。
请求
www.example.com/index.htm?¶meter1=value1¶meter2=value2结果
www.example.com/index.htm?parameter1=value1¶meter2=value2我已经做了几次尝试,但没有得到正确的规则。
发布于 2022-11-18 09:57:48
听起来很直接:
RewriteEngine on
RewriteCond %{QUERY_STRING} ^&(.*)$
RewriteRule ^ %{REQUEST_URI}?%1 [R=301,L]似乎奏效了:
https://htaccess.madewithlove.com?share=26758c0f-cc73-4400-a525-c540d0b8ca65
https://stackoverflow.com/questions/74486892
复制相似问题