title: Apache authentication except localhost
body: <p>I need to apply HTTP auth just in public use of website, but I don't apply it on my localhost. This is the <code>.htaccess</code> that I think should work. But it doesn't work - it still asks me for user/pass.<br>
  What am I doing wrong? </p>
  
  <pre><code>SetEnvIf Remote_Addr ^127\.0\.0\.1$ develmode
  &lt;IfDefine !develmode&gt;
      AuthType Basic
      AuthName "ADMIN"
      AuthUserFile /path/to/.htpasswd
      Require valid-user
  &lt;/IfDefine&gt;
  </code></pre>
  
  <p><code>mod_setenvif</code> is enabled of course.</p>