0

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/

4

1 回答 1

0

首先,您需要安装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>
于 2012-07-11T09:14:13.097 回答