3

I have 2 copies of my website synced with Subversion. One live version and one developer version. What I like to do is to password protect the developer version, using a .htaccess file:

AuthType Basic
AuthName "Restricted Files"
AuthUserFile ../.htpasswd
AuthPGAuthoritative Off
Require user dev 

Is there a way to sync this .htaccess file to the live version without the password protection there?

I was thinking about something like

[if file exists ../.htpasswd]
  AuthType Basic
  AuthName "Restricted Files"
  AuthUserFile ../.htpasswd
  AuthPGAuthoritative Off
  Require user dev 
[/if]

or

[if currentDir = /path/to/dev/version]
...
[/if]
JochenJung
  • 7,183
  • 12
  • 64
  • 113
  • Unfortunately, if statements are not supported. Do you have access to the global apache config for your dev server? – clmarquart Mar 29 '11 at 21:45
  • I'm looking for the same answer here: http://stackoverflow.com/questions/6143176/how-can-i-password-protect-dev-but-not-live-while-using-svn – celiker May 27 '11 at 08:03

1 Answers1

0

Finaly found the answer over here: How can I password protect dev but not live while using SVN?

If mod_setenvif is enabled one can set different env vars

SetEnvIfNoCase ^HOST$ .+ unauthenticated
SetEnvIfNoCase ^HOST$ ^dev\.example\.com$ !unauthenticated
Community
  • 1
  • 1
JochenJung
  • 7,183
  • 12
  • 64
  • 113