www as a subdomain

Zippy

Verified User
Joined
Sep 27, 2004
Messages
5
I would like to manage a www folder in my public_html director in the same way as other subdomains.

I tried adding a www subdomain, but I see from the custom HTTPD that this idea is squashed due to the default virtual server hijacking the documentroot for the www server.

Is there some way around this? I like to treat my subdomains as mini-sites, so www for me, deserves it's own folder...


Cheers,
 
Wahey, answered my own question!

.htaccess to the rescue (as usual!)

#---------------------------------------------------
# .htaccess file for "domain.co.uk"
#---------------------------------------------------

RewriteEngine On
Options +FollowSymlinks
RewriteBase /


#---------------------------------------------------
# www home
#---------------------------------------------------

RewriteCond %{HTTP_HOST} www.domain.co.uk$
RewriteCond %{REQUEST_URI} !/www/
RewriteRule ^(.*)$ /www/$1
 
Back
Top