Monday, 9 December 2013

OHS: Virtual Host With Redirect

Apache: Virtual Host With Redirect

In your httpd.conf, under Virtual Hosts

In this example we will be redirecting example.website.com to example.website.com/prac/
This redirect only works when landing on / with no additional URI

<VirtualHost *:80>
 ServerName  example.website.com
 RewriteEngine on
 RewriteRule ^/$ /prac/ [R]
</VirtualHost>

#bearMan