.htaccess help for multiple parked domains.

  • Thread starter Thread starter Nem
  • Start date Start date

Nem

Nem

Associate
Joined
2 Feb 2003
Posts
1,620
Location
Mansfield, Notts.
'lo all

I could do with a bit of help with my htaccess file I think.

I've bought 12345.co.uk and 12345.com

12345.co.uk is on hosted space and is my 'main' domain. I have parked 12345.com onto that domain via the control panel for 12345.co.uk and this works fine. Problem is that I'm getting two results in google for what is the same site which I'm told may cause me problems with duplicate content.

I've been told that I can use a redirect in the htacess file to basically send any traffic which arives via with .com address back to the same page but on the .co.uk address, which will basically sort out the google listing problem.

The only other problem was that I initially had the forum root as www.12345.co.uk/forum/ which I have now moved to just www.12345.co.uk root folder. Half the google listings are still in the /forum url. Now I've already sorted that out in the htaccess file and so anything inbound on the /forum url is transfered to the same page but without the /forum path.

Is the .com to .co.uk redirect possible for this situation? If it is then any help would be great.

Thanks

Nick
 
This does the trick for me:

Code:
RewriteEngine On
RewriteBase /

# Ensure user is viewing correct domain name
RewriteCond %{HTTP_HOST} secondary-domain.co.uk$ [NC]
RewriteRule ^(.*)$ http://www.master-domain.eu/$1 [R=301]
 
Stunning. Tested and working fine.

So I assume then that the secondary domain listings on google will dissapear over time now that they all auto redirect to the primary domain.

Thanks mate!

Nick
 
Back
Top Bottom