found answer, see end of message
How do you restrict access to a file by IP when you are hosted in a cluster / cloud environment (more precisely, Rackspace Cloud). Yesterday I asked a similar question here and got the following answer, which worked great (thanks) in my local test environment.
<Files test.html>
Order allow,deny
Deny from all
Allow from 123.123.123.123
</Files>
However, what I came to find out that the W / Rackspace Cloud is that by the time the visitor gets to the page (or, as far as .htaccess w / is concerned), the IP address has already changed.
I discovered this when I tested the .htaccess directive, where my true IP address did not give me access, but my own hosting IP worked.
With some other tests, I also learn that in my cloud environment, the visitor's IP address is passed through "HTTP_X_FORWARDED_FOR" instead of "REMOTE_ADDR".
Does anyone have a good workaround with this? Is there a directive in .htaccess that I can change the IP.htaccess is looking for?
(Yes, I will post the same question to Rackspace.)
answer added
so after several hours of scratching the head with their online support, the directive to use with at least Rackspace Cloud is this:
<Files filename.htm>
SetEnvIf X-Cluster-Client-Ip 000.000.000.000 allowclient
SetEnvIf X-FORWARDED-FOR 000.000.000.000 allowclient
order deny,allow
deny from all
allow from env=allowclient
</Files>
depending on whether you are behind an SSL cluster or not, you will use the "X-Cluster-Client-Ip" (not SSL) or "X-FORWARDED-FOR" (SSL) directive to match up your ip.