Subdomain redirect help

Soldato
Joined
28 Oct 2002
Posts
9,227
Location
Stockport / Manchester
Hi,

I have a subdomain setup, sub.mydomain.com, the contents of which live in www.mydomain.com/sub/.

When I go to the subdomain it works fine. When I go to www.mydomain.com/sub/ it also works fine, but that is the problem!

I want www.mydomain.com/sub/ to go to sub.mydomain.com. I can't for the life of me figure out how to get it to do it. I'm guessing I'd have to use mod_rewrite, which I am terrible at! Anyone have any idea how to do it?

Cheers!



PS, I don't think it will matter, but this is my current .htaccess file. It just makes sure www. is always there.

Code:
Options +FollowSymLinks
RewriteEngine On

RewriteCond %{HTTP_HOST} ^mydomain\.com$ [NC]
RewriteRule ^.*$ http://www.mydomain.com%{REQUEST_URI} [R=301,L]
 
Back
Top Bottom