/ Published in: Apache
Expand |
Embed | Plain Text
RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC,OR] RewriteCond %{HTTP_HOST} ^domain\.com$ RewriteCond %{REQUEST_URI} !subdir/ RewriteRule (.*) /subdir/$1 [L]
Comments
Subscribe to comments
You need to login to post a comment.

This snippet not only lets the root point to the sub directory, but also makes it dependent on the domain name. I needed this for having a whole directory structure under a main domain, but having domain aliases using sub directories in it without the ability, to make each one a real vhost.