【问题标题】:Write a redirect rule to .htaccess with %使用 % 将重定向规则写入 .htaccess
【发布时间】:2012-12-04 19:46:22
【问题描述】:

我正在尝试编写一个 RewriteRule 以便我可以重定向一个像

这样的 url
http://example.com/cont.php?fdsfsd=fdsfsd

到带有字符 %3 的参数的 url,例如:

http://example.com/another.php?var=ntvpz2hrzm0&cof=FORID%3dsa

【问题讨论】:

    标签: apache .htaccess redirect


    【解决方案1】:

    在%前面加一个反斜杠

    RewriteRule cont.php another.php?var=ntvpz2hrzm0&cof=FORID\%3dsa [R=301,NE,L]
    

    NE 标志也可能是必要的,以防止后面的进程试图转义 % 符号。

    【讨论】:

      猜你喜欢
      • 2020-11-01
      • 2016-06-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多