title: Apache same file with and without password from different ip
body: <p>I have a question to a complex apache configuration (apache 2.2). Is the following possible, and if yes, how:</p>
  
  <p>From some IPs access to particular files should be allowed without authentication.
  From other IPs access to the same files should be allowed with authentication only.
  From all other IPs access should not be allowed.</p>
  
  <p>I've tried with</p>
  
  <p>general:</p>
  
  <pre><code>Order deny,allow 
  deny from all
  </code></pre>
  
  <p>Then two blocks for the specified directory:</p>
  
  <pre><code>&lt;Location /testverzeichnis/index.html&gt;
       AuthType Basic 
       AuthName "blabla" 
       Deny from all 
       Allow from &lt;IP1&gt; 
       AuthUserFile /srv/www/apache/.htpasswd 
       Require user scht
  &lt;/Location&gt; 
  </code></pre>
  
  <p>This does work! I got a window for user/password, and on the second machine access is not allowed.</p>
  
  <p>Then I tried to get access without password from the second machine: </p>
  
  <pre><code>&lt;Location /testverzeichnis/index.html&gt; 
       Deny from all 
       Allow from &lt;IP2&gt;
  &lt;/Location&gt; 
  </code></pre>
  
  <p>But then I got the authentication box on the second machine!</p>
  
  <p>Is this possible at all?</p>
  
  <p>Thank you in advance!</p>
  
  <p>Regards
  Burkhard</p>