In my web config
<authorization>
<deny users="?" />
<allow roles="Employee" />
</authorization>
<authentication mode="Forms">
<forms loginUrl="~/Account/LogOn" timeout="2880" />
</authentication>
Then when I go to the page
HTTP/1.1 302 Found
Cache-Control: private
Content-Type: text/html; charset=utf-8
Location: /Account/Login?ReturnUrl=%2f
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Tue, 23 Oct 2012 22:34:55 GMT
Content-Length: 145
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="/Account/Login?ReturnUrl=%2f">here</a>.</h2>
</body></html>
Why does LogOn not give me that but rather Login?
IIS 7.5
Site is
using the forms auth "hack" from
Add this key to your web.config:
<appSettings>
<add key="loginUrl" value="~/Account/LogOn" />
</appSettings>
Evidently there can be some redirection going on within the DLL's to a different "loginUrl", especially if the WebMatrix dll's are in the path.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.