How to change the document root in XAMPP on windows

I have installed XAMPP in C drive on my windows. Today I thought I will move my installation to another directory.

After searching the web for couple of minutes, I got a solution that worked perfectly. Here are the steps you have to follow.

  1. Open the file httpd.conf from the location C:/xampp/apache/conf
  2. Search for DocumentRoot and you will get something like this

    DocumentRoot “C:/xampp/htdocs”

  3. Update the DocumentRoot to new location. For example, if you want to update the DocumentRoot to D:/www , then you will have the following line after updating the location

    DocumentRoot  “D:/www”

  4. Then find the Directory and you will fine something similar to

    <Directory “C:/xampp/htdocs”>

  5. Update it to new location like this

    <Directory “D:/www”>

  6. Then finally restart the Apache server using XAMPP control panel or manually.

That’s it, you are done. The DocumentRoot has been moved to new place successfully.

Leave a Reply

Your email address will not be published. Required fields are marked *