Programming, error messages and sample code
301 Redirect from Default.aspx to Root
Programming, error messages and sample code > IIS Rewrite
E.g. Redirect http://yourdomain.com/default.aspx to http://yourdomain.com
First create a web.config file in your root directory if it's not already there. Second, put the following code into your web.config file.
First create a web.config file in your root directory if it's not already there. Second, put the following code into your web.config file.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Default Document" stopProcessing="true">
<match url="(.*)default.aspx" />
<action type="Redirect" url="{R:1}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>