web.config and authentification, authorization, location
<p>I'm looking to create a web.config file and I'm a little confused about which order do which tags go. I have 2 roles: testers and previewers.</p>

<p>Here's what I'm looking to do:</p>

<p>1) use the forms authentification tag with url "Login.aspx"</p>

<p>2) use the location tag to say that the directories /AppPages and /AppServices are only accessible to testers (ie. deny *, ?, previewers and allow authentificated testers only, deny everyone else)</p>

<p>3) use the location tag to say that the directories /Scripts and /Styles is only accessible to testers and previewers and deny everyone else</p>

<p>4) how do I make it so that all previewers who attempt to look into the /AppPages or /AppServices pages get rerouted to a custom page.</p>

<p>I have the following web.config file:</p>

<p></p>

<p></p>

<pre><code>&lt;system.web&gt;

  &lt;connectionStrings&gt;
    ...............
  &lt;/connectionStrings&gt;

  &lt;roleManager enabled="true"/&gt;

  &lt;authentication mode="Forms"&gt;    
     &lt;forms loginUrl="Login.aspx" name=".ASPXFORMSAUTH"&gt;
     &lt;/forms&gt;
  &lt;/authentication&gt;

  &lt;authorization&gt;
     &lt;deny users="?" /&gt;
  &lt;/authorization&gt;

  &lt;location path="AppPages"&gt; //same for AppServices
    &lt;system.web&gt;
      &lt;authorization&gt;
        &lt;deny users="*" /&gt;
            &lt;deny users="?"/&gt;
        &lt;allow roles="tester" /&gt;
        &lt;deny roles="previewers" /&gt;
      &lt;/authorization&gt;
    &lt;/system.web
  &lt;/location&gt;

  &lt;location path="Scripts"&gt; //same for Styles
    &lt;system.web&gt;
      &lt;authorization&gt;
          &lt;allow roles="previewers" /&gt;
          &lt;allow roles="tester" /&gt;
          &lt;deny users="?"/&gt;
      &lt;/authorization&gt;
    &lt;/system.web&gt;
  &lt;/location&gt;

&lt;/system.web&gt;
</code></pre>

<p></p>

<p>What I'm looking to do is have all users be redirected to the preview page and if the user is logged in as a tester then he'll be able to move on to the app pages while previewers will not.</p>

<p>Thanks for your suggestions.</p>
