Heres the situation: I have a couple of different web projects running on a single shared host. Project 'A' is accessed through a subdomain (subA.mydomain.com) while project 'B' is the main mydomain.com
Both A and B are symlinks inside the host's public_html folder:
ln -s /home/myhost/ProjectA ~/public_html/subA
ln -s /home/myhost/ProjectB ~/public_html/main
The subdomain (project A) works fine and the site is running on it. For 'B' which is the main domain, i have used .htaccess to point primary domain to a subfolder as written here. The domain website is also working fine.
The problem is when i do mydomain.com/subA, the subdomain website (project A) opens. I tried adding redirect rules to point mydomain.com/subA --> subA.mydomain.com like so:
RewriteCond %{HTTP_HOST} ^mydomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.mydomain.com$
RewriteRule ^subA\/?$ "http\:\/\/subA\.mydomain\.com\/" [R=301,L]
But the url still reads mydomain.com/subA and the website shown is project A (with images and static files missing obviously as its a different web project).
Why isn't the redirect working?