Multiple domains to single website

242 views Asked by At

I have multiple domains pointing at the same website. (FFFF.com, FFFF.ca, FFFF.org, etc)

What's the best way to achieve a rewrite to FFFF.com all incoming traffic?

URL rewrites or 301s? Looking for best practice. These two would be dealt with within htaccess right?

Thanks,

2

There are 2 answers

0
menacingly On BEST ANSWER

You would want to do a 301 in this instance. In general, if you're trying to figure out which method is best practice, it's usually the choice that makes it clear to the client what is going on. Transparently re-writing makes it look like three domains have the same content. A 301 politely informs the client that the content resides somewhere else.

2
anubhava On

Use this code in your .htaccess:

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} !^(www\.)?FFFF\.com$ [NC]
RewriteRule ^ http://FFFF.com/%{REQUEST_URI} [R=301,L]

This basically 301 redirects all the URIs to FFFF.com if domain name in request is NOT FFFF.com.