• 0

Web Page Redirection


Question

Hi,

I have a number of Domains like www.domain.com, www.domain.co.uk, www.domain.eu, www.thedomain.com, www.thedomain.co.uk etc. which are all variations of the domain name i want.

I would like to have www.domain.com as my main site and have all other domains redirect to the .com.

I've set up my web hosting to mirror the www.domain.com domain, so all sites are physical mirrors of www.domain.com however i've noticed in search results i see www.thedomain.com etc show up whereas www.domain.com does not and am wondering if mirroring was the best move?

How can i inform search sites that all my domains point to www.domain.com and to ignore www.domain.co.uk or www.thedomain.com, is this possible?

Thanks

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

You will need to setup your .htaccess file to redirect all of your secondary domains permanently to your main domain.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^thedomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.thedomain.com$
RewriteRule ^/?$ "http\:\/\/domain\.com" [R=301,L]

Don't forget that you will also need to chose whether you want www or no-www for domain.com.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]

Link to comment
Share on other sites

  • 0

You will need to setup your .htaccess file to redirect all of your secondary domains permanently to your main domain.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^thedomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.thedomain.com$
RewriteRule ^/?$ "http\:\/\/domain\.com" [R=301,L]

Don't forget that you will also need to chose whether you want www or no-www for domain.com.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]

Brilliant! Thanks for this.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.