Htaccess for addon domains

Written by Ashley on April 13, 2008 – 4:30 pm -

For those of you that make use of add-on domains on your hosting accoumt, its important to setup an .htaccess file to redirect any visitors or bots who find their way to one of the subdomains., to aviod duplicate content issues.

There are three (well six actually!) ways of accessing an add-on domain:

Root domain name (ie. www.addondomain.co.uk)

Subdomain (ie. www.addondomain.the-hosting-domain.co.uk)

Subfolder (ie. www.the-hosting-domain.co.uk/addondomain)

Then of course you have the same three again without the www.

So in order to avoid duplicate sites being spidered and indexed, we can use a few command in the .htaccess file so that all possible names resolve at www.addondomain.co.uk.

Here is what you need to put in you htaccess file in the directory that houses your add-on domain ie. www.the-hosting-domain.co.uk/add-on/ :
Code:
Options +FollowSymlinks
RewriteEngine OnRewriteCond %{HTTP_HOST} ^addondomain\.co.uk [NC]
RewriteRule ^(.*) http://www.addondomain.co.uk/$1 [R=301,L]

RewriteCond %{HTTP_HOST} ^www.addondomain.the-hosting-domain\.co.uk
RewriteRule ^(.*)$ http://www.addondomain.co.uk/$1 [R=permanent,L]

RewriteCond %{HTTP_HOST} ^addondomain.the-hosting-domain\.co.uk
RewriteRule ^(.*)$ http://www.addondomain.co.uk/$1 [R=permanent,L]

And add this to the .htaccess file in the root domain: ie. www.thehostingdomain.co.uk
Code:
Options +FollowSymlinks
RewriteEngine OnRedirect /addondomain http://www.addondomain.co.uk

That should work! :-)

Please note in my example:

addondomain = Rootdomain name
the-hosting-domain = The domain name that hosts your add-on domain.

Feel free to ask any questions.


Posted in SEO | 1 Comment »

Avoiding Canonicalisation of your URL

April 13, 2008 – 4:12 pm

Many hundreds and thousands of websites are potentially damaging their ...

No Comments »

301 Redirects - moving a web page

April 13, 2008 – 4:10 pm

If you are moving content between page or domains on ...

No Comments »

Get your site indexed within 24 hours

April 13, 2008 – 4:04 pm

Want to get your site indexed and listed within google ...

No Comments »

Free Ranking Checker Tool

March 31, 2008 – 5:36 pm

I noticed that Aaron Wall from Seobook.com has released a ...

1 Comment »

Domain Parking Reviews

March 29, 2008 – 4:32 pm

Our quick parking services reviews and domain parking comparison will ...

No Comments »

Finding a domain and a niche

March 29, 2008 – 3:51 pm

I thought i'd share some tips with you on how ...

No Comments »

Why Use Mini sites?

March 29, 2008 – 3:49 pm

It doesn't really matter why you bought that domain is ...

No Comments »

Anyone for Cheese on Toast?

March 29, 2008 – 3:49 pm

Whats better One 'Big' site or lots of small sites? ...

1 Comment »

.co.uk, .org.uk or .me.uk

March 29, 2008 – 3:38 pm

When choosing a .UK domain name, there are usually three ...

No Comments »
RSS