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/

Owen Blacker
  • 4,117
  • 2
  • 33
  • 70
Alessandro
  • 305
  • 2
  • 8
  • 22

1 Answers1

0

First of all you'll need to install the URL Rewrite Module.

Then create a rule like this:

<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>
Owen Blacker
  • 4,117
  • 2
  • 33
  • 70
Nelson
  • 325
  • 2
  • 9