We have an internal ASP.NET Webforms application running on a Windows 2008/IIS7 server which has been running fine until we installed MVC3.
Now any requests redirect
Updated answer for MVC 4, heavily borrowed from this page and ASP.NET MVC issue with configuration of forms authentication section (and answered on both pages)
<appSettings>
...
<add key="PreserveLoginUrl" value="true" />
</appSettings>
...
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" timeout="43200" /> <!--43,200 in minutes - 30 days-->
</authentication>
We added some WCF SOAP related things to an existing IIS site and it caused this problem, with the site refusing to honour the web.config authentication redirect.
We tried the various fixes listed without success, and invented a work around of mapping the new weird URL back to the one we've been using for years:
<urlMappings enabled="true">
<add mappedUrl="~/loginout.aspx" url="~/Account/Login"/>
</urlMappings>
That worked but it's ugly. Eventually we traced it down to a web.config entry added by Visual Studio some time earlier:
<add key="webpages:Enabled" value="true" />
As we'd been unable to work out precisely what that does, we took it out, which solved the problem for us immediately.