【问题标题】:Substitute missing parameter in Apache rewrite rules替换 Apache 重写规则中缺少的参数
【发布时间】:2013-11-12 01:50:31
【问题描述】:

谁能告诉我如何将 first 双下划线('__') 替换为 '_2000' 之类的值。

www.mysite.com/abc/Price_10000__10500__ -- 应该改为www.mysite.com/abc/Price_10000_2000_10500__

请注意,除了 URL 中的“Price_”之外,没有任何数据是静态的。

谢谢

【问题讨论】:

    标签: apache .htaccess url-rewriting httpd.conf


    【解决方案1】:

    你可以试试这个规则:

    RewriteRule ^([^/]+)/(Price_\d+)__(\d+.*)$ /$1/$2_2000_$3 [L,NC,R]
    

    【讨论】:

      猜你喜欢
      • 2010-12-05
      • 2011-10-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-30
      • 2016-08-09
      • 2012-07-12
      • 2015-12-06
      相关资源
      最近更新 更多