title: How to negate the 'Allow from env' in Apaches htaccess?
body: <p>I want to restrict the access with a specific domain with htaccess. At first I am trying to deny the access to my restricted-domain.com, and then I will implement the "login".</p>
  
  <pre><code># set the "require_auth" var if Host ends with "example2.com"
  SetEnvIfNoCase Host restricted-domain\.com$ require_auth=true
  
  # Auth stuff
  AuthUserFile /html/typo3/.htpasswd
  AuthName "Password Protected"
  AuthType Basic
  
  # Setup a deny/allow
  Order Deny,Allow
  Deny from all
  # except if either of these are satisfied
  Satisfy any
  #require valid-user
  #or 2. the "require_auth" var is NOT set
  Allow from env=!require_auth
  </code></pre>
  
  <p>This ends in 403 on both domains. So I commented Deny from all and checked in my PHP whether the variable require_auth is set or not. This was correct, it was NULL at the public domain and true on the restricted. So I tried it without the negation:</p>
  
  <pre><code>Allow from env=require_auth
  </code></pre>
  
  <p>This works great except that it behaves the opposite way. I cant flip the logic, because there are many public domains and they will vary in the future. So how can I negate the Allow from env directive?</p>
  
  <p>Thanks a lot!</p>