【问题标题】:Rewrite Rules with question mark in ISAPI在 ISAPI 中用问号重写规则
【发布时间】:2013-05-13 20:26:09
【问题描述】:

我有一个需要帮助的重写问题。 从此 URL 重写: mydomain/x.cfm?color=pink&page=1

到这个网址:

mydomain/pink--x.cfm?page=1

使用以下规则:

RewriteEngine On
RewriteCond %{QUERY_STRING} ^(color=.*&page=*)?$
RewriteRule ^shop/(.*)--(.*)?page=(.*)/?$  shop/$2.cfm?color=$1&page=$3 [R,NC,L]

但它给了我粉红色--x.cfm 不是错误? 我的重写规则有问题吗? 提前致谢

【问题讨论】:

    标签: isapi isapi-rewrite


    【解决方案1】:

    如果您需要从此 URL 重写:mydomain/x.cfm?color=pink&page=1 到这个 URL:mydomain/pink--x.cfm?page=1 规则应该是

    RewriteEngine On
    RewriteBase /
    RewriteCond %{QUERY_STRING} ^color=(.*)&page=(.*)$ [NC]
    RewriteRule ^([^/.]+)\.cfm$  /%1--$1.cfm?page=%2 [R,NC,L]
    

    【讨论】:

      猜你喜欢
      • 2010-10-05
      • 1970-01-01
      • 2013-12-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-07
      • 1970-01-01
      • 1970-01-01
      • 2010-10-09
      相关资源
      最近更新 更多