Forum Moderators: phranque

Message Too Old, No Replies

condition logic in htaccess file?

is it possible? (not mod rewrite)

         

pixeltierra

10:10 pm on Dec 27, 2006 (gmt 0)

10+ Year Member




Since paths to .htpasswd files must be absolute, and my test server htpasswd path doesn't match my production server path, I end up having to disable my .htaccess (i.e. rename it) on my test server.

How can I make the following command work only if the %{HTTP_HOST} is a certain host:

AuthUserFile "/home/the/path/to/the/.htpasswd"

jdMorgan

11:31 pm on Dec 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, you can't. But you might try using a commonly-named symlink, one on each machine, to point a 'virtual' passwd file to the real ones. I don't actually know if it will work, but it may be worth a try. Be sure to set the permissions on the symlinks carefully.

Jim