1

Today I moved my application from a server with IIS6 to a new one with IIS7.5 (windows server 2008 R2).

The odd thing is that I cannot access the default document although it has been set in the default documents section. The file is the "deault.aspx" and when I try to access the page with ip I am getting http://[IP]/login.aspx?ReturnUrl=%2f, but it works fine If I access it directly.

This is the settings from web.config

<authentication mode="Forms">
  <forms protection="All" loginUrl="login.aspx" name="CookieName" timeout="49200" requireSSL="false"/>
</authentication>
<authorization>
  <deny users="?"/>
</authorization>

 <location path="Default.aspx">
<system.web>
  <authorization>
    <allow users="*"/>
  </authorization>
</system.web>
</location>

I've already tried to solve this with some of the suggestions that are written here [ Forms Authentication Ignoring Default Document ] , but with no luck.

I want to solve it by configure somehow the server and not the application.

Thanks

SOLUTION

I don't know if it is the correct one, but I change the mode of the application pool into classic instead of integrated.

Community
  • 1
  • 1
profanis
  • 2,741
  • 3
  • 39
  • 49

2 Answers2

1

For me, removing the ExtensionlessUrl-* handler mappers in IIS Manager for the site in question did the trick. Even though all this does is adds the relevant entries to web.config that I had already tried with no luck.

Dylan Nicholson
  • 1,235
  • 14
  • 20
1

Add the following to the web.config and it will allow you to access Default.aspx without requiring prior authentication. All other pages will require authentication.

<location path="default.aspx">
    <system.web>
        <authorization>
            <allow users="*"/>
        </authorization>
    </system.web>
</location>

Just because a document is added as the default within the IIS configuration does not mean it bypasses the FormsAuthentication.

ChrisBint
  • 12,773
  • 6
  • 40
  • 62
  • As I mentioned in my post, I can access the file directly. This means that I have add this setting. Thanks – profanis Nov 01 '11 at 11:24