0

in htaccess file is it possible to use relative paths? i'm looking to see if exists any way to use relative paths so i would not change them on a new server

AuthUserFile {WEBSPACEROOT} auth/.password
AuthGroupFile {WEBSPACEROOT} auth/.group

AuthName "Reserved Area"
AuthType Basic

WEBSPACEROOT is my web server root

2

1 Answer 1

0

Yes you can, but i wouldnt recommend it. They have to be relative to the ServerRoot which is defined in the apache docs as

The ServerRoot directive sets the directory in which the server lives. Typically it will contain the subdirectories conf/ and logs/. 
Relative paths in other configuration directives (such as Include or LoadModule, for example) are taken as relative to this directory.

Is there any reason you require them to be relative? it would be easier to understand if you used the full path.

1
  • on development i use a protecter folder, that i upload on server, different serve of different hosting and i need to correct each time the path, or i can use the same folder on local machine, staging server and production server.
    – user1412077
    Sep 5, 2013 at 12:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.