Make XAMPP/Apache serve file outside of htdocs

If you use XAMPP for development, you have to use the htdocs folder to store your production/development files. If you want to map any other folder to use as a development path, you can just do the following settings.

Edit the value of  DocumentRoot setting in XAMPP\apache\conf\httpd.conf.

It should currently be:


Change it to the folder you wish


Points to note.

  • Don’t forget to edit it in BOTH lines that ask for DocumentRoot. If you only change the top one, you’ll get read-access errors.
  •  You have to use forward slashes “/” instead of back slashes “\”.
  • Don’t include the trailing “/” at the end.