when I don't have a trailing slash IIS7 automatically does a redirect, how do I fix this..
so http://mydomain.com/deals will redirect to http://mydomain.com/deals/
when I don't have a trailing slash IIS7 automatically does a redirect, how do I fix this..
so http://mydomain.com/deals will redirect to http://mydomain.com/deals/
首先,您需要安装URL Rewrite Module。
然后创建这样的规则:
<rule name="AddTrailingSlashRule" stopProcessing="true">
<match url="(.*[^/])$"/>
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
</conditions>
<action type="Redirect" url="{R:1}/" logRewrittenUrl="true"/>
</rule>