Search This Blog

Monday, December 12, 2011

URL Rewrite to Remove .aspx in IIS 7 (& DNN

Add this to the <system.webServer> section:

<rule name="RemoveASPX" enabled="true" stopProcessing="true">
<match url="(.*)\.aspx" />
<action type="Redirect" url="{R:1}" />
<conditions logicalGrouping="MatchAll">
<add input="{URL}" pattern="(.*)/default.aspx" negate="true" />
<add input="{URL}" pattern="(.*)/admin/*" negate="true" />
<add input="{URL}" pattern="(.*)/desktopmodules/*" negate="true" />
<rule name="AddASPX" enabled="true">
<match url=".*" negate="false" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{URL}" pattern="(.*)\.(.*)" negate="true" />
<action type="Rewrite" url="{R:0}.aspx" />

1 comment:

  1. DotNetNuke contains a collection of reusable components and libraries, as well as a large catalog of third party Dotnetnuke modules.

    DNN Developer