apache domain redirect to subfolder
- by Dennis
I have a hosting account with godaddy. Its a linux system running apache. The way they do their setup is your primary domain is the root folder. When you add a subdomain its in a subfolder of the root which sucks. I want to setup a subfolder structure to organize my domains.. I called godday support and they said to use redirects.. but did not know how to do that..
How its setup now:
primary domain:
www.domain.com /
sub.domain.com /sub
I want to create a directory structure and then redirect to each but only show www.domain.com in the url
www.domain.com /domain/www
sub.domain.com /domain/sub
I tried using:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
RewriteRule ^(/)?$ domain/www [L]
but it just changes the url to www.domain.com/domain/www
Can this be done in htaccess?