Finding the absolute path of a directory.
In case of problems with the path in htaccess and htpasswd, if you need to know the absolute path of a directory, it is quite simple: the realpath() function does just that.
Just create a php file that can be called e.g. absolute-path.php and will contain:
<?php echo realpath ('absolute-path.php');>
This file will be placed in the folder where the htpasswd is. In our example, we use the admin folder but this can be done to any other folder to protected.
To get the result - i.e. the path you need to know - simply type : http://name_of_your_site.ext/admin/absolute-path.php into the address bar of your browser.
You will of course replace "name_of_your_site.ext " by the actual name of your site. For example here freeguppy.org: www.freeguppy.org .