So, you have installed XAMPP on windows, changed its server port to a different number other than 80 and changed the MySQL root password to a more secure one. Now its the time to create some HTML files that will be served by XAMPP server.
By default, XAMPP serves any file that is located under the directory [xampp_installation_folder]/htdocs, which means that you have to copy all your HTML/PHP files inside this directory. But what if you maintain a different folder for all your projects files and you want XAMPP to serve them too along with htdocs?
Lets make XAMPP to do this.
- Open the file [xamp_installation_folder]/apache/conf/httpd.conf in any text editor.
- Copy below lines after the htdocs <Directory> element after changing the directory to your own folder.
<Directory "C:/path/to/your/folder"> Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Order allow,deny Allow from all </Directory> - Then search for this string: <IfModule alias_module>. Inside that element, add a new alias as followed:
Alias /yoursite/ "C:/path/to/your/folder/yoursite/"
- Save the file and restart the XAMPP server.

Hi! I'm Veera Sundar. I am a web application developer. I usually build the application end-to-end using Java on the back-end and JavaScript on the front end. 
{ 3 comments… read them below or add one }
hey thanks for this wonderful post.. i was looking something similar
Hi Veera,
This is typically called as DocumentRoot in Apache, if I am right.
A good post though.
This worked for me the other day with XAMPP 1.7.6, php 3.5.5. Now it does not work with XAMPP 1.7.7 and php 3.5.8.