Apache - Redirect traffic from root to subdirectory

02 Jun 2017

I’m using an Amazon Linux AMI, but the steps are general.

Edit your .conf file - sudo vim /etc/httpd/conf/httpd.conf

Add the following under <Directory></Directory>.

<Directory>
    # You may have existing parameters here. Don't touch.
    RedirectMatch ^/$ /blog/
</Directory>

This would redirect any traffic coming to our root directory to /blog/, which, incidentally, is how you got here, if you just visited daviseford.com :)