How to change the document root in XAMPP for Windows

Do the following steps:

  • XAMPP Control Panel -> Apache -> Config -> httpd.conf
  • find the codes:
    DocumentRoot “C:/xampp/htdocs”
    <Directory “C:/xampp/htdocs”>
  • change them to your new folder:
    DocumentRoot “D:/www”
    <Directory “D:/www”>
  • copy all the contents from “C:/xampp/htdocs” to “”D:/www” “
  • restart the Apache

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.