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
Why not just setup a canonical name (CName) on your DNS server to automatically redirect http://domain.com to http://www.domain.com?
See the CName explanation on wikipedia
I fixed it by adding the following rule: