When using Xampp, default location of  Localhost folder is : C:\xampp\htdocs . However, for some reason such as IDE workspace, backup purpose , you want to change this location.So, you just have to do one things. Change the DocumentRoot path in the  httpd.conf file which located at C:\xampp\apache\conf .

Open the httpd.conf file and search : DocumentRoot. You can find it the first time at line with the content :

# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
DocumentRoot " C:\xampp\htdocs "
Change the path of folder that you want.

And the next DocumentRoot is :
# This should be changed to whatever you set DocumentRoot to.
<Directory " C:\xampp\htdocs ">
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
Do it again with the same path before.

Restart the Apache service of Xampp . Check your work ! ^^