I'm having problems with my asp.net 4.0 Web Forms application not allowing anonymous access to landing page.
My problem is the following
- If I access the site using URL "localhost/website/default.aspx", the default page is shown. When I click on the login button on the page, the users is logged in as expected.
- If I access the site using URL "localhost/website", the user is taken directly to the login page. The expected behavior is that the "default.aspx" page will be displayed.
I'm testing on Windows 7/64 using VS2010. My web.config section looks like
<authentication mode="Forms">
<forms name=".xxxxADAuthCookie" loginUrl="~/Login.aspx" timeout="45"
defaultUrl="~/secure/Default.aspx" slidingExpiration="true" />
</authentication>
<membership defaultProvider="MyADMembershipProvider">
<providers>
<clear />
<add attributeMapUsername="sAMAccountName" name="MyADMembershipProvider"
type="xxxxx.xxxxxxFormsAuthenticationMembershipProvider" />
</providers>
</membership>
<authorization>
<deny users="?" />
<allow users="*" />
</authorization>
<location path="default.aspx">
<system.web>
<authorization>
<allow users="?" />
</authorization>
</system.web>
</location>