I recently created a new web site using the Visual Studio 2012 "ASP.NET Empty Web Site" template, added a login.aspx and default.aspx page and then added the required forms authentication settings to the web.config.
<authentication mode="Forms"> <forms loginUrl="~/login.aspx" name=".BlahBlahBlah" /> </authentication> <authorization> <deny users="?" /> </authorization>
I browsed to the new website and noticed it was giving me a 404 error. When inspecting the URL, I noticed it was redirecting me to "Account/Login". I started looking through all the code and... nothing, no mention of this URL. I restarted every known process remotely linked to IIS and still nothing. Now, from experience I know this URL is included when creating a default MVC application using Visual Studio, so somewhere deep inside I had a feeling this was a Microsoft "gotcha" that was going to cost me at least 3 cups of coffee. Luckily, when I was at cup 2.4536 I noticed this little line in the web.config.
<add key="webpages:Enabled" value="true" />
Commented it out and all of a sudden, the application redirects to "login.aspx" as specified in the web.config... I'll need to investigate a little deeper into exactly what this setting does and how it got there, but figured I'd put this up for now to save someone out there 3 cups of coffee.
Any questions, let me know