I would like to map this:
http://www.example.com/index.php?param1=value1¶m2=value2¶m3=value3 (etc. ad infinitum)
为了
http://www.example.com/index.php?param1=newvalue1¶m2=value2¶m3=value3 (etc.)
换句话说,只需更改查询字符串中单个参数的值。我知道旧值是什么,所以我正在尝试匹配精确文本
index.php?param1=value1
并将其替换为index.php?param1=newvalue1
。我似乎找不到任何使用mod_rewrite执行此操作的示例。非常感谢您的任何帮助。
L
标志只是结束当前的处理。但它也会重新注入请求并导致从第一条规则开始重复处理(请参见http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriteflags)。`P`标志是使用代理来请求重写后的URL并将响应传回给客户端。这确实需要mod_proxy。 - Gumbo