Hi all,
I'm having a bit of problem achieving this scheme:
I have two domains: domainA.com and domainB.com
1) I want to point domainA.com to a folder called /Myfolder/ (/ is the DocumentRoot)
2) I want to point domainB.com to a folder called /Yourfolder/
I also want to have a couple of subdomains:
1) tools.domainA.com to go to folder /tools/
2) projects.domainA.com to go to folder /Myfolder/projects/
I've got the following in my .htaccess but I'm having some problems:
RewriteCond %{HTTP_HOST} ^(www.)?domainA.com$
RewriteCond %{REQUEST_URI} !^/Myfolder/
RewriteRule ^(.*)$ /Myfolder/$1
RewriteCond %{HTTP_HOST} ^(www.)?tools.domainA.com$
RewriteCond %{REQUEST_URI} !^/tools/
RewriteRule ^(.*)$ /tools/$1
RewriteCond %{HTTP_HOST} ^(www.)?projects.domainA.com$
RewriteCond %{REQUEST_URI} !^/Myfolder/projects(/.*)?$
RewriteRule ^(.*)$ /Myfolder/projects/$1
RewriteCond %{HTTP_HOST} ^(www.)?domainB.com$
RewriteCond %{REQUEST_URI} !^/Yourfolder/
RewriteRule ^(.*)$ /Yourfolder/$1
when I type in any addresses of type projects.domainA.com or click on links within pages accessed through that subdomain, I get the whole path in address bar:
eg. projects.domainA.com/test2/test.php becomes projects.domainA.com/Myfolder/projects/test2/test.php
Can anyone tell me what I'm doing wrong and if there is a better way of managing these things.
Thanks in advance for any advice,
Still