By continuing your navigation on this site, you accept the use of cookies to offer you contents and adapted services. Legal Notice.

GuppY Help Center, help online, documentation and tutorials



You are here :   Welcome » Finding the absolute path of a directory.
    Print this page...
    Print this section...

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 .

Creation date : 10/02/2014 @ 21:58
Category : - Htaccess
Page read 14835 times