Redirect domain.(co.uk|com) => www.domain.(co.uk|com)

Using a single web hosting account to host multiple sites

Redirect domain.(co.uk|com) => www.domain.(co.uk|com)

Postby darkangelgt » Wed Jan 31, 2007 9:35 am

I've been searching around all over the place, but this rule still manages to elude me. What I'm trying to do is redirect two tlds with the same domain name (domain.com and domain.co.uk) to their www.domain.(co.uk|com) equivalent. Can anyone out there help?
darkangelgt
 
Posts: 2
Joined: Wed Jan 31, 2007 9:31 am

Postby richardk » Thu Feb 01, 2007 1:44 pm

This should do it:
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(domain\.(com|co\.uk))$ [NC]
RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby darkangelgt » Thu Feb 01, 2007 2:04 pm

A million thanks, let's see how it goes. :)
darkangelgt
 
Posts: 2
Joined: Wed Jan 31, 2007 9:31 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 7 guests

cron