IIS7 and 301 permanent redirects using the location tag in web.config
- by Mike
I need to setup some 301 permanent redirects in the web.config of an ASP.NET MVC application running under IIS.
The easiest way is to add a tag similar to the one below to the web.config file:
<location path="TheMenu.aspx">
<system.webServer>
<httpRedirect enabled="true" destination="menus/" httpResponseStatus="Permanent" />
</system.webServer>
</location>
When I go to the site at http://domain.com/TheMenu.aspx it redirects me to http://domain.com/menusxd instead of http://domain.com/menus.
What would be causing this?