How to Find the Absolute Path on Your Web Server

find your web server absolute pathFrom time to time, especially when moving a website from one server to another, I have to find out what the “absolute path” of my website is. ¬†Absolute path pertains to the directory on the server that the website is installed on.

Sometimes when moving a Joomla, WordPress or other website to a different directory or different server you’ll need to change the absolute path for the site to work. In joomla this requires editing the configuration.php file, in WordPress this sometimes requires editing the database or ensuring that you update the settings before moving your files/database over to the new directory/server.

How do I find out what the absolute path is?

The easiest way is to create a file named pathinfo.php and paste only the following code into that file:

   $path = getcwd();
   echo "Your Absoluthe Path is: ";
   echo $path;

Now, upload pathinfo.php into the root directory of your website and view it in your internet browser ( example: )

This will display your absolute path.

Tags: , , ,

This entry was posted on Friday, July 17th, 2009 at 4:06 pm and is filed under How To, web design. You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.

2 Responses to “How to Find the Absolute Path on Your Web Server”

  1. praddep Says:

    Excellent trick to find absolute path of any webserver. thanks for sharing it.

  2. Priyank Says:

    Thanks.. this tip made my day. I was struggling to find the absolute path for my site.

Leave a Comment