P
P
pdx2011-02-01 11:30:09
Apache HTTP Server
pdx, 2011-02-01 11:30:09

How to set relative paths to .htpasswd?

AuthType Basic<br/>
AuthName &quot;Say the password or bite my shiny *ss&quot;<br/>
AuthUserFile /home/u*****/example.com/foo/.htpasswd <br/>
Require valid-user<br/>

How can I set a relative path to .htpasswd to make it work?
In this case, you need this standard .htaccess file to be uploaded to the repository and then used in any project, so you don’t want to specify absolute paths (as in this example).

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
MiXei4, 2011-02-01
@MiXei4

Relative paths are not supported. We'll have to write absolute.

R
Riateche, 2011-02-01
@Riateche

httpd.apache.org/docs/1.3/mod/mod_auth.html#authuserfile
File-path is the path to the user file. If it is not absolute (ie, if it doesn't begin with a slash), it is treated as relative to the ServerRoot.

B
Borro, 2011-02-01
@Borro

Try it with the help of a server programming language, in php, for example, you can do this .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question