【问题标题】:URL Rewrite 2.0 Wildcards - IIS 7.5URL 重写 2.0 通配符 - IIS 7.5
【发布时间】:2013-06-01 05:12:29
【问题描述】:
<rule name="WomensSilverBangles" patternSyntax="ExactMatch">
    <match url="/Bangles/Silver/Womens.aspx" />
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
    <action type="Rewrite" url="Collections/jewellery.aspx?AXSW_CategoryID=Bangles&amp;AXSWFinenessId=Silver&amp;AXSW_GenderID=Womens&amp;MenuName=Jewellery&amp;SiteMapNode=Silver Bangles&amp;depth=2" />
</rule>

这可以用通配符写吗?

如您所见,匹配网址中的三个变量用于重写的网址字符串。

【问题讨论】:

  • 你能更精确一点吗?你有什么变量,例如Bangles总是Bangles
  • 抱歉,所有三个目录(Bangles/Silver/Womens)都是每个 URL 的变量。
  • 你能试试像这里的东西吗:stackoverflow.com/questions/1108473/…

标签: regex url-rewriting iis-7.5


【解决方案1】:

我知道这个问题发布已经有一段时间了,但是有一篇关于重写 here 的优秀文章,基于此,您可以尝试尝试类似的东西(未测试):

    <rule name="3levelcatchall" patternSyntax="Wildcard">
      <match url="/*/*/*.aspx"/>
      <action type="Rewrite" url="Collections/jewellery.aspx?AXSW_CategoryID={R:1}&amp;AXSWFinenessId={R:2}&amp;AXSW_GenderID={R:3}&amp;MenuName=Jewellery&amp;SiteMapNode={R:2} {R:1}&amp;depth=2" appendQueryString="false"/>
    </rule>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-01-06
    • 1970-01-01
    • 2012-05-23
    • 2016-03-07
    • 2015-05-11
    • 1970-01-01
    • 2011-10-21
    • 2013-07-26
    相关资源
    最近更新 更多