使用IIS 7.5的IIS重写器我想拥有以下URL: http://www.contoso.com/FOLDER1/FOLDERX/PLACE2/SomeImportantText/1bab8a84-8d06-478f-badd-6af4248661a7/MoreImportantText 转换成: http://www.contoso.com/something.aspx?X=SomeImportantText&Y=1bab8a84-8d06-478f-badd-6af4248661a7&Z=MoreImportantText 应该排除域名,以便这是一个相对网址。 我如何在web.config文件
中执行此操作我正在尝试:
<rules>
<rule name="Rewrite Language">
<match url="^/FOLDER1/FOLDERX/PLACE2/([^/]*)/([^/]*)/([^/]*)$" />
<action type="Rewrite" url="/something.aspx?X={R:1}&Y={R:2}&Z={R:3}" />
</rule>
</rules>
答案 0 :(得分:0)
这有效:
<rule name="Working Rewrite Language">
<match url="^FOLDER1/FOLDERX/PLACE2/([^/]*)/([^/]*)/([^/]*)$" />
<action type="Rewrite" url="something.aspx?X={R:1}&Y={R:2}&Z={R:3}" />
</rule>