Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

242
Views
Why won't apache2.conf deny access to the specified directory?

I have an authentication defined in my .htaccess on my dev domain but I want to put it in apache2.conf instead. If I try to cut/paste the lines, the authentication stops working.

This is my configuration for the directory in question:

<Directory /home/dev>
    AllowOverride None

    <FilesMatch "^.*\.([Hh][Tt][AaPp])">
        Require all denied
    </FilesMatch>

     #AuthType Basic
     #AuthName "Dev Domain"
     #AuthUserFile "/home/dev/public_html/.htpasswd"
     #Require all denied

    #Previously in .htaccess
    SetEnvIf Host dev.mywebsite.com auth
    AuthType Basic
    AuthName "Dev domain"
    AuthUserFile "/home/dev/public_html/.htpasswd"
    Require valid-user

    # first, allow everybody
    Order Allow,Deny
    Satisfy any
    Allow from all
    Require valid-user
    # then, deny only if required
    Deny from env=auth
</Directory>

Any form of Require (Require all denied, Require valid-user) or Deny seems to be ignored. Even the AllowOverride None doesn't work because if I put these lines in /home/dev/public_html/.htaccess, the authentication works.

RewriteRules works though.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!