我已经实现了标准的登录控制,一切正常。ASP.NET登录控制劫持我的404
但是,当我输入一个无效的URL时,它会被重定向到登录页面。
例如
mywebsite.com/xxx正确地给出了404
但
mywebsite.com/xxx.aspx导致重定向到登录页面
我使用ASP.NET 3.5在Windows Server 2008年
我已经设置了web.config中有以下
也
<httpErrors existingResponse="Replace">
<remove statusCode="403" />
<remove statusCode="404" />
<remove statusCode="500" />
<error statusCode="403" path="/xyz/NoAccess.htm" responseMode="Redirect" />
<error statusCode="404" path="/xyz/FileNotFound.htm" responseMode="Redirect" />
<error statusCode="500" path="/xyz/FileNotFound.htm" responseMode="Redirect" />
</httpErrors>
认证是通过web表单
<authentication mode="Forms">
<forms loginUrl="Login.aspx" defaultUrl="~/External/SomeView.aspx"></forms>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
如此看来登录页面被劫持我的404 如何使http://www.mywebsite.com/xxx.aspx返回404,而不是重定向到的登录页面?
要清楚我不认为这是授权问题,即403问题。 我已经在指定的/ xyz目录中有一个单独的web.config。事实上,我可以通过访问mywebsite.com/xyz/FileNotFound.htm而无需登录即可看到FileNotFound.htm。 但是,如果我输入类似于mywebsite.com/SomeNonExistantPage.aspx的内容,浏览器将使用以下URL重定向到登录页面mywebsite.com/Login.aspx?ReturnUrl=%2fSomeNonExistantPage.aspx 如果我然后登录,它只会重定向到404页面。 –
BigPoo
2010-08-31 12:31:43