Forum Moderators: phranque

Message Too Old, No Replies

htaccess http to www. with sub domains

I'm lost

         

GerBot

6:55 pm on Jul 18, 2005 (gmt 0)

10+ Year Member



Hi Guys,
I've been able to get my htaccess file to 301 redirect [domain.com...] to [domain.com...]

but....

I've not been able to get
[sub.domain.com...] to redirect to
[sub.domain.com...]

I've read here

[webmasterworld.com...]

and ended up with this but it is not working

RewriteEngine on
RewriteCond %{HTTP_HOST} ^sub\.domain\.co\.uk
RewriteRule ^(.*) [sub.domain.co.uk...] [L,R=301]

any ideas?

thanks

jdMorgan

8:02 pm on Jul 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There's nothing wrong with your code that would cause it to fail.

Are you sure that this code is located in a directory that will be accessed when sub.domain.com is requested? If the code is not in the server path for those subdomains, then it will not be executed.

Are your DNS records and server configured to resolve and handle arbitrary subdomains?

Jim