title: forms authentication asp.net vb
body: <p>I have a log in page which is the home page so is located at www.domainname.com</p>
  
  <p>when someone goes to this page it adds a returnurl to the string so they are at:</p>
  
  <p>www.domainname.com/default.aspx?ReturnUrl=%2f so when they log in they get returned to <a href="http://www.domainname.com/" rel="nofollow">http://www.domainname.com/</a>, which is the login page again, so to access the site they have to login twice.</p>
  
  <p>Does anyone know how to fix this? I think a fix to this would be to allow everyone access to the home page - <a href="http://www.domainname.com/" rel="nofollow">http://www.domainname.com/</a> as well as <a href="http://www.domainname.com/default.aspx" rel="nofollow">http://www.domainname.com/default.aspx</a> but i'm not sure how to acheive this.</p>
  
  <p>I want all user roles to be denied access to every page apart from the home page before they login, i also have an admin/cms section that only Admin roles can access but everyone can access the cms login page.</p>
  
  <p>I currently have this in my web.config</p>
  
  <pre><code>        &lt;authentication mode="Forms"&gt;
          &lt;forms protection="All" loginUrl="default.aspx" defaultUrl="~/home/" /&gt;
      &lt;/authentication&gt;
      &lt;authorization&gt;
          &lt;allow roles="Admin, User"/&gt;
          &lt;deny users="?" /&gt;
      &lt;/authorization&gt;
  
      &lt;location path="default.aspx"&gt;
      &lt;system.web&gt;
          &lt;authorization&gt;
              &lt;allow users="*" /&gt;
          &lt;/authorization&gt;
      &lt;/system.web&gt;
  &lt;/location&gt;
  
  &lt;location path="cms/default.aspx"&gt;
      &lt;system.web&gt;
          &lt;authorization&gt;
              &lt;allow users="*" /&gt;
          &lt;/authorization&gt;
      &lt;/system.web&gt;
  &lt;/location&gt;
  
  &lt;location path="cms"&gt;
      &lt;system.web&gt;
          &lt;authorization&gt;
              &lt;allow roles="Admin"/&gt;
              &lt;deny users="*"/&gt;
          &lt;/authorization&gt;
      &lt;/system.web&gt;
  &lt;/location&gt;
  </code></pre>