How to change XAMPP Apache default directory

The default Apache root directory for XAMPP will be
{xampp directory}/ htdocs. But what if we have several PHP project working on or need to create project at different directory? Below is the steps on how to change the default root directory for Apache in XAMPP

  1. Navigate to your {xampp directory}/apache/conf and open up httpd.conf or click on the apache config button inside the XAMPP control panel and select httpd.conf
  2. Look for the keyword DocumentRoot inside the httpd.conf
  3. Change the value of DocumentRoot to the new project path
  4. Change the value of Directory to the new project path
  5. Save and close the httpd.conf file
  6. Stop and Start Apache Service from XAMPP control panel
  7. Done!

Before changes for httpd.conf file


How to change XAMPP Apache default directory
Tagged on:     

Leave a Reply

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