Restricting access via .htaccess on Balanced Servers
The Need.. test servers need to access the staging server with no user/pass requirement..
The Problem, Servers are behind a balancer that masks the originating IP address; can't use the classic "Allow from 127.0.0.1" in .htaccess
Solution: use a variable, however we have to go grep way to match the IP address.
SetEnvIf X-Forwarded-For "^127\.0\.0\.1$" AllowAccess
Allow from env=AllowAccess
Satisfy any
You can use this service to get the right grep for IP address ranges
Written by Salvador Aceves
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Apache
Authors
nekwebdev
47.02K
petenicholls
33.47K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#