In this post, I’ll explain how to find the absolute path of your website;
An absolute path, is the complete structure of directories, related to “root”, the first directory of the whole system. In Linux the root directory is known as:
From there, the most typical structure to the “absolute website path” or directory that contains your website files would be:
Or it can be anything as difficult as:
This structure can change depending on the server. If you have command line access, with bash it’s as easy as typing “echo $HOME”.
If you don’t have shell access (command line), you need to create a simple php file and upload it to your website folder.
Open up your favourite text editor and add these lines:
$path = getcwd();
echo “Absolute Path: “;
Save it, let’s say as “path.php” & upload it to your public_html folder, or wherever the files are located for your website. Then open up the path.php file in your web browser, ex. http://www.domain.com/path.php
You will see the absolute path printed on the page.
This is method will work for WordPress or any other websites.
Thanks for reading, and questions welcome!