Change Websites Default Folder to Another Folder in Apache

Apache is the most used server. It is used to serve more than half of all active websites. It will be very helpful to understand Apache. Understanding the configuration of virtual host of Apache is important as sometime it will be a tough job to do. I will show you how to set default folder of a website other than root directory of Apache.

I assume you have your default apache directory is in /var/www/ and you want to change that for a certain website.


Normally you will have to use folders inside /var/www/ to get successful result but it will be nice to keep the site in other folder like /home/

<VirtualHost *:80>
DocumentRoot /home/
<Directory />
 Options FollowSymLinks
 AllowOverride None

 <Directory "/home/">
 Options Indexes FollowSymLinks MultiViews
 AllowOverride None
 Require all granted

Above configuration will do the work. If it works or doesn’t work please let me know by leaving comment. Thank you.