[英]Forms authentication in Community Server
我的网站上存在表单身份验证问题。 当用户未登录时,他们将被重定向到登录页面,该页面工作正常。 但是,我希望将未经授权的用户重定向到新页面(welcome.aspx)。 更改了web.config后,我得到以下HTTP错误500.19-内部服务器错误:
Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'redirect'
这是我的web.config的相关部分:
<authentication mode="Forms">
<forms name=".CommunityServer" protection="All" timeout="60000" loginUrl="welcome.aspx" slidingExpiration="true" />
</authentication>
<location path="Default.aspx">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>
如果我将Visual Studio设置为使用Visual Studio Development Server而不是本地IIS WebServer,则一切正常。 另外,如果我将welcome.aspx重命名为login.aspx,它也可以正常工作。
任何帮助表示赞赏。
你有没有尝试过
<authentication mode="Forms">
<clear />
<forms name=".CommunityServer" protection="All" timeout="60000" loginUrl="welcome.aspx" slidingExpiration="true" />
</authentication>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.