如果用户未通过身份验证,我将以下内容添加到我的 web.config 以将用户重定向到登录页面,但是转到 URL 会导致重定向吗?
<location path="user/add">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>
我有设置表单验证。像这样:
<authentication mode="Forms">
<forms loginUrl="/user/login"
protection="All"
timeout="30"
name="MyCookie"
requireSSL="false"
slidingExpiration="true"
defaultUrl="default.aspx"
/>
</authentication>
使用 .net 和 mvc。