Replacing a querystring parameter value using mod_rewrite

后端 未结 2 1978
醉酒成梦
醉酒成梦 2020-12-18 03:48

I would like to map this:

http://www.example.com/index.php?param1=value1¶m2=value2¶m3=value3 (etc. ad infinitum)

to

2条回答
  •  星月不相逢
    2020-12-18 04:34

    Try this rule:

    RewriteCond %{QUERY_STRING} ^(([^&]*&)*)param1=value1(&.*)?$
    RewriteRule ^index\.php$ /index.php?%1param1=newvalue1%3 [L,R=301]
    

提交回复
热议问题