Authentication Ignoring Default Document

一个人想着一个人 提交于 2019-12-11 10:13:09

问题


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.


回答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.




回答2:


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.



来源:https://stackoverflow.com/questions/7965600/authentication-ignoring-default-document

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!