If there is web.config :
<configuration> <system.web> <authentication mode="Forms"> <forms name="MembershipCookie" loginUrl="Login.aspx" protection="All" timeout="525600" slidingExpiration="true" enableCrossAppRedirects="true" path="/" /> </authentication> <authorization> <deny users="?" /> </authorization> </system.web> <location path="Default.aspx"> <system.web> <authorization> <allow users="*"/> </authorization> </system.web> </location> </configuration>
The application is an ASP.NET 2.0 application running on Windows 2008R2 / IIS7.5.
If the site application pool is configured to run ASP.NET 2.0, and I am browsing http://example.com , then Default.aspx displayed as you would expect from the above rules.
However, if the application pool is configured to run ASP.NET 4.0, I am redirected to the login page. If I explicitly specify http://example.com/default.aspx then everything will be fine and Default.aspx display.
I tried to rewrite / -> /default.aspx (using IIS UrlRewriter 2.0), but the result is still the same, I got to the login page.
I also tried this with an ASP.NET 4.0 application with the same result (this is where the problem arose). The reason I tried this with app 2.0 was to see if there was a change in behavior, and it seems that / handled differently in 4.0.
So, to summarize, using the configuration above, the following is observed:
ASP.NET Version Url Behavior
-------------------------------------------------- -----------------------
2.0 http://example.com Renders Default.aspx
2.0 http://example.com/Default.aspx Renders Default.aspx
4.0 http://example.com Redirects to Login.aspx
4.0 http://example.com/Default.aspx Renders Default.aspx
Is this a bug / change, or am I missing something obvious?
Update:
I have the bottom of this problem, see my own answer below.
Kev Feb 22 '11 at 16:23 2011-02-22 16:23
source share