Htaccess auth, based on server, not client information

Solution 1:

you should add these to your .htaccess authentication/authorization directives.

setenvif Server_Addr=1.2.3.4 okpublic
allow from env=okpublic
require valid-user
satisfy any

if the server address is 1.2.3.4 then we set an environment variable that we will use on the second line to allow access to anyone. if server address is not 1.2.3.4 then users must authenticate. if any of these 2 rules are satisfied then access is granted.

what I did is weird but oh well, if this is what you want :)

another solution, much more simpler would be to ignore the .htaccess file when doing svn update on the production server, using svn propedit svn:ignore. if you need to have different .htaccess file on prod and dev then maybe you want to look into branching, merging, etc. or maybe the multi-purpose .htaccess file is just better. I felt like mentioning svn controls as well.