我正在尝试使用IIS将旧网站的内容重定向到新网站。我的重写地图如下所示:
<rewriteMaps>
<rewriteMap name="Redirects">
<add key="/q/R.208-9899.aspx" value="/bla/garden/childrens-gardening/cat3376588.cat"/>
<add key="/store/dvd/lego-the-adventures-of-clutch-powers/8%3a939022" value="/bla/entertainment-books/dvd/cat12590010.cat" />
<add key="/store/dvd/world-steam-today--north-central-and-south-america/8:470831" value="/bla/entertainment-books/dvd/cat12590010.cat" />
</rewriteMap>
</rewriteMaps>
我的web.config
看起来像这样:
<rule name="Redirect rule1 for Redirects" enabled="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{Redirects:{REQUEST_URI}}" pattern="(.+)" />
</conditions>
<action type="Redirect" url="http://www.example.com{C:1}" appendQueryString="false" />
</rule>
第一个网址正常,但第二个网址无效。
任何指针都很有用。