Jump to content

whats the directory above htdocs


deansaddigh

Recommended Posts

Where have you placed the .htpasswd file? I guess the most likely place would to put it in the private folder?

 

If its in the private folder, and you're going to be calling the .htpasswd file from a .htaccess file within the htdocs/ folder, then you'd reference the file using ../private/.htpasswd

 

../ means to go one level higher in the directory tree.

Does this look correct to you, because im getting a 500 error faster than lightining.

 

htacess

 

AuthName "Restricted Area" 
AuthType Basic 
AuthUserFile ../private/.htpasswd 
AuthGroupFile /dev/null 
<Files phpmyadmin>
require valid-user
</Files>
<Files admin>
require valid-user
</Files>

 

 

AuthUserFile needs to be a full path on the server. I.E. /home/user/private/.htpasswd

 

To find the full folder path, create the following file:

phpinfo.php

with the following:

<?php

echo phpinfo();

?>

 

Put this folder in the htdocs folder and go to the file via your web browser and look for the full path. Then when you know the full server path put this in your .htaccess file.

 

-steve

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.