How To Setup Many Web Folders in XAMPP – Cross OS, Apache, MySQL, PHP, Perl (XAMPP) Stack for Web Development

The topic of this article is how to set up many web folders in XAMPP.

We assume you are an upper beginner at least a web developer in PHP/MySQL.


For complete beginners read here:
What is XAMPP & How To download:

https://www.apachefriends.org/download.html

https://www.javatpoint.com/xampp-vs-wamp-vs-mamp-vs-lamp


Using XAMPP you must know that: if installed to the default directory:

c:/xampp/

or

D:/xampp/

your web folder is:

c:/xampp/htdocs/

or

D:/xampp/htdocs/

respectively … and access as http://localhost/

What if your web projects as a PHP/MySQL Web Developer or/and JavaScript Web Developer are for example at:

D:/Documents/Web Projects/

or

C:/Documents/Web Projects/

and you do NOT want to move them to another directory…


Here you will learn how to – leave folders as are and add the directories as aliases to XAMPP setup/configuration:

D:/Documents/Web Projects/ alias e.g. /repo2, accessed as http://localhost/repo2/

or

C:/Documents/Web Projects/ alias e.g. /repo3, accessed as http://localhost/repo3/


For users who want to follow a SlideShare Presentation, go to -1- below;

For those who want to follow a YouTube video, go to -2- below…;

If you want a Fast How-To continue reading this Article below -3- …


-1-


-2-


-3-

For the example at the top of this article: let’s say we have a Development Windows 10 or 11 PC/Laptop & XAMPP installed at c:/xampp/ … :

Development folder-1:

D:/Documents/Web Projects/
alias e.g.
/repo2
accessed as http://localhost/repo2/

or

Development folder-2:

C:/Documents/Web Projects/
alias e.g.
/repo3
accessed as http://localhost/repo3/

repo2 or repo3 aliases names should be strings without space, avoid special chars, and must be anything string convenient to you.

You have to find the configuration file:
httpd-xampp.conf
and add the code at the bottom above the last line of

</IfModule>

FINAL RESULT:

Alias /repos2 "D:/Documents/Web Projects/"
<Directory "D:/Documents/Web Projects">
   AllowOverride AuthConfig
   Require local
</Directory>

Alias /repos3 "C:/Documents/Web Projects/"
<Directory "C:/Documents/Web Projects">
   AllowOverride AuthConfig
   Require local
</Directory>


</IfModule>

Usually, the httpd-xampp.conf is at:

C:\xampp\apache\conf\extra\httpd-xampp.conf

Alternatively, there is a shortcut to access XAMPP conf files, etc. files… see:




This article was a step-by-step ASAP Configuration/Setup.

For more details see the SlideShare Presentation and/or the YouTube Video.