I am trying to change the default URL of my Asp.Net website on IIS. At the moment the URL leading to the default index.html, is just http://myservername/. But I would actually prefer to extend the URL to http://myservername/route1, which then still routes to the default html. How can I achieve this?
1 Answer
Download Microsoft URL Rewrite Module and install it
and add this to your web.config
<system.webServer>
<rewrite>
<rules>
<rule name="Root Hit Redirect" stopProcessing="true">
<match url="^$" />
<action type="Redirect" url="/route1" />
</rule>
</rules>
</rewrite>
</system.webServer>
2 Comments
Dennis Schiepers
I'm getting a 404 error now. Probably because the route1 does not lead to anything to the website. How can I fix this?
Dennis Schiepers
In IIS creating an application 'route1' inside the website was the solution. However the rule you gave is perfect to redirect users which route to the websites url.