【问题标题】:htaccess 301 redirect from URL with commas does not redirecthtaccess 301 从带有逗号的 URL 重定向不重定向
【发布时间】:2012-08-29 10:44:38
【问题描述】:

我有少量 URL,我想在我的 .htaccess 文件中进行 301 重定向。

问题是,原始 URL 包含一些奇怪的参数格式,这似乎破坏了重定向。

基本上我需要这个重定向才能工作:

redirect 301 "/index.php?id=365,0,0,1,0,0" http://example.com/about/

example.com 也有一个 index.php 文件,但在我看来它应该重定向。

有人对此有见解吗?

谢谢

【问题讨论】:

    标签: .htaccess url redirect url-rewriting


    【解决方案1】:

    ?id=365,0,0 ... 替换为\?id=(\d\d\d.*)$

    RewriteRule http://example.com/index.php?id=(\d\d\d.*)$ http://www./example.com/about/ [R=301,L]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-10-11
      • 1970-01-01
      • 2013-12-21
      • 2015-03-04
      • 2014-01-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多