<p>I added the following to my web.config to redirect the user to the login page if they aren't authenticated, but going to the URL does cause a redirect?</p>

<pre><code> &lt;location path="user/add"&gt;
    &lt;system.web&gt;
      &lt;authorization&gt;
        &lt;deny users="?" /&gt;
      &lt;/authorization&gt;
    &lt;/system.web&gt;
  &lt;/location&gt;
</code></pre>

<p>I have setup forms authen. like this:</p>

<pre><code>&lt;authentication mode="Forms"&gt;
      &lt;forms loginUrl="/user/login"
             protection="All"
             timeout="30"
             name="MyCookie"
             requireSSL="false"
             slidingExpiration="true"
             defaultUrl="default.aspx"
             /&gt;


    &lt;/authentication&gt;
</code></pre>

<p>Using .net and mvc.</p>

For one of my applications I have the following in the same node as
```
<authentication>
```
:
```
```
<authorization>
    <deny users="?"/>
</authorization>
```
```
But this covers the entire application...