我需要创建的web.config规则将改写为文件的所有请求与扩展的.html为.asp和重定向所有的.asp请求为.htmlIIS URL重写重写所有的.asp为.html
例:
file_xyz.asp重写为file_xyz.html
directory1中/ file_xyz.asp重写移到directory1/file_xyz.html
和
file_xyz.html重定向到file_xyz.asp
directory1中/ file_xyz.html重定向移到directory1 /file_xyz.asp
- 规则的语法是什么
- 这是一个过于宽泛的规则吗?如果我需要知道有什么理由需要物理文件,例如file_abc.html,我该如何从重定向规则中排除它?
- 我想我应该只使用ISAPI_Rewrite http://www.isapirewrite.com/似乎有很多资源用于重写htaccess,并且很少使用IIS 7 URL重写的在线帮助。任何想法和/或建议
在此先感谢
到目前为止,这是语法我有在web.config
<rule name="RewriteHTMLtoASP" stopProcessing="true">
<match url="^([^/]+)\.html$" />
<conditions logicalGrouping="MatchAll" />
<action type="Rewrite" url="{R:1}.asp" />
</rule>
<rule name="RedirectASPtoHTML" stopProcessing="true">
<match url="^([^/]+)\.asp$" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_METHOD}" pattern="^GET$" />
</conditions>
<action type="Redirect" url="{R:1}.html" appendQueryString="false" />
</rule>
听起来像一个无限循环等待发生(ASP - > html - > asp ...) – Oded 2010-05-07 18:42:51