title: IIS7 401 Error Redirecting (Mixed Authentication)
body: <p>Ok , so i have a web application in wich i developed a mixed authetication mode. I've made two pages for login (i am using IIS7) , one for forms login named login.aspx, and other for windows loginnamed winlogin.aspx. The Web config looks like this : </p>
  
  <pre><code>&lt;authentication mode="Forms"&gt;
        &lt;forms cookieless="UseCookies" defaultUrl="Default.aspx" loginUrl="Login.aspx" name="xxx" path="/" protection="All" timeout="30"&gt;&lt;/forms&gt;
      &lt;/authentication&gt;
      &lt;authorization&gt;
        &lt;deny users="?" /&gt;
        &lt;allow users="*" /&gt;
      &lt;/authorization&gt;
    &lt;/system.web&gt;
  
  &lt;location path="WinLogin.aspx"&gt;
      &lt;system.web&gt;
        &lt;authorization&gt;
          &lt;allow users="*" /&gt;
        &lt;/authorization&gt;
  </code></pre>
  
  <p>In IIS i've set for winlogin page Anonymous Authentication to disabled and windows authentication to enabled , so i am able to get the windows authentication popup (for windows username and password). Everything   works , i am sending a cookie with ["LOGON_USER"] to forms and the user is authenticated. The problem is when trying to push cancel button on popup (with the default error pages set on IIS 7 (401.htm, 500.htm...) and Feature settings to show on server error just the page for custom errors ,the 401.htm page is brought to me. This behavior it's ok, but when i change  custom error page(for 401 error) to get back to me to Login.aspx (so the users can then authenticate with forms based) when the users hit's cancel button, something strange happens. When i load WinLogin.aspx the popup doesn't appear and i am automatically redirected to Login.aspx . I don't know why is doing this, it means that a server eror(401) ocured. strange.. .Also with this page set for 401 error but with Feature Settings set to : "Detailed error for local request and custom..." my popup comes again , and works to authenticate. If anybody can explain this behavior .</p>