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

198
Views
.htaccess - Allow IP range with authentication & bypass for one page

I'm struggling with a .htaccess file to accomplish the following:

I have a subdomain with our admin console in

  • Grant access to /pagecheck/ from any IP without authentication (health check script)
  • Block access to all other resources from any IP that is not on our list of approved IPs
  • Request HTTP authentication popup for any allowed IPs

I'm struggling to block access from "outside" IPs as I can't seem to get the reordering right.

This is the code that works for /pagecheck/ and authentication:

SetEnvIfNoCase Request_URI "^/pagecheck/" noauth

AuthName "Admin Area"
AuthType Basic
AuthUserFile /home/production/.htpasswd
require valid-user

Order Deny,Allow
Deny from all
Allow from env=noauth
Satisfy any
DirectoryIndex index.cgi
Options -Indexes

However, I'm struggling to get the logic in the right place to only allow access from our office IP address range. I think it is conflicting with the different Orders and the authentication.

Could anyone help? Thanks

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!