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