Many website owners wisely buy related domain names at the same time as buying their chosen domain – after all, you don’t want your competitors to be able to occupy your space and benefit from misspellings and confusion between .com, .net, .org, .co.uk, etcetera.
Of course, you’ll be one of those wise website owners. But having bought the secondary domain names, you’ll want to make them work for you rather than lying idle. So the question arises: how can you set up domain forwarding on them so that your primary domain gets maximum benefit in the search engines?
Make sure you have permanent (Code 301) redirects
There are several ways of redirecting traffic, but the key point is to make sure that the redirect is handled as a permanent redirect (HTTP status code 301) rather than a temporary one (HTTP status code 302). Otherwise search engines may well penalise you for duplicate content – or at the very least fail to pass on link popularity from your secondary domain to your primary one.
Here’s a quick look at the various ways of redirecting traffic (from a *nix/Apache perspective – Windows servers have their own set of instructions):
Entry in your httpd.conf file
This is probably the neatest way of redirecting as it requires the server to carry out the instruction once only, rather than every time a page request is made. Unfortunately users of shared hosting are unlikely to have access to system files like httpd.conf, but your hosting provider may make the change for you if you ask nicely.
Entry in your .htaccess file
This is the second best option, and is probably good enough unless your secondary domain is attracting heavy traffic. You should be able to find the .htaccess file in your web root directory (often called “www” or “public_html”) – if not, make one and set the permissions to 644 (owner gets read-write permission, everyone else gets read-only). Then add this code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^([^.:]+\.)*secondarydomain\.co\.uk\.?(:[0-9]*)?$ [NC]
RewriteRule ^(.*)$ http://www.primarydomain.com/$1 [R=301,L]
Any URL at the secondary domain (eg www.secondarydomain.co.uk/mygreatpage.htm) will then be automatically redirected to the primary domain (www.primarydomain.com/mygreatpage.htm).
You can also do individual page redirects if you need to, but that’s a rather more labour-intensive process.
Registrar-provided URL forwarding
Many domain registrars offer you the facility to forward traffic from one domain to another. Unfortunately, they usually use a temporary redirect (Code 302) to do this, so you may dilute your link popularity.
Domain parking
You can get your secondary domain “parked” on top of your primary domain so that when people request www.secondarydomain.co.uk/mygreatpage.htm, they’re actually shown the content from www.primarydomain.com/mygreatpage.htm – although the URL in their address bar is still on the secondary domain. This can lead to search engines listing both pages for the same content (and has been exploited by spammers for that reason), so it’s not a great solution.
JavaScript meta-refresh redirects
You can include a JavaScript snippet in your page header to redirect to a given page within a specified number of seconds. This can be time-consuming to set up if you’re dealing with a lot of pages, of course. It’s also frowned upon by the search engines because people have abused it by creating optimised content for one topic, then forwarding to a page flogging blue diamond-shaped pills or such like.
Checking that it’s all working
Whichever method you choose, you’ll need to check that it’s working properly and that you’re getting Code 301 redirects. There are several server header checking tools around – just do a search and you should find one that works for you. Rex Swain’s HTTP Viewer works well.