I have the follow rule in IIS7:
<rule name="RewriteAll" stopProcessing="true">
<match url="^([^/]+)/?$" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{URL}" negate="true" pattern="\.axd$" />
<add input="{URL}" negate="true" pattern="\.png$" />
<add input="{URL}" negate="true" pattern="\.gif$" />
<add input="{URL}" negate="true" pattern="\.jpg$" />
<add input="{URL}" negate="true" pattern="\.css$" />
<add input="{URL}" negate="true" pattern="\.js$" />
</conditions>
<action type="Rewrite" url="default.aspx?page={R:1}" />
</rule>
That catch urls like http://mysite.com/contact/
I can't figure out with rule to use to catch http://mysite.com/ and send to for example home.aspx. Can anyone help me with the match regex
I fixed it by adding the following rule:
<rule name="Index Request" enabled="true" stopProcessing="true">
<match url="^$" />
<action type="Rewrite" url="index.aspx" logRewrittenUrl="true" />
</rule>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With