How to redirect your subdomain to your new domain

Posted on March 23rd, 2007.


Before this, I run this blog on free subdomain hosting from eizil.com under the address korokmu.eizil.com. After I had enough money, I bought a domain, Techlogs.net and asked the owner of eizil.com to use my domain with the hosting. Thanks to him because allowing me to still using his free service with my own domain. He had setup the add-on domain for me and everything worked smoothly.

After few days, I realized that my blog still can be accessed using the subdomain. Moreover, my blog is listed on Google and Yahoo with the address http://korokmu.eizil.com. And the fact that Google does not like duplicate content make me worry a little bit. I need to redirect the subdomain to my new domain. Before this, I've writen about redirecting a webpage using PHP. But this trick cannot be done because the index of korokmu.eizil.com and techlogs.net is the same. Therefore, I searched for other solution.

Luckily, I've found the .htaccess trick. It is just simple. What you need to do is, copy the code below in your .htaccess file and replace the domain.com with your domain.

HTML:
  1. Options +FollowSymLinks
  2. RewriteEngine on
  3.  
  4. RewriteCond %{HTTP_HOST} !^www.domain.com [NC]
  5. RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]

And the most important part is, this redirection is search engine friendly. You can use this tool to check whether your redirection is friendly or not.

Related Links:
.htaccess forward subdomain to domain
Comprehensive Guide to .htaccess

Bookmark this post on del.icio.us:How to redirect your subdomain to your new domain digg:How to redirect your subdomain to your new domain spurl:How to redirect your subdomain to your new domain wists:How to redirect your subdomain to your new domain simpy:How to redirect your subdomain to your new domain newsvine:How to redirect your subdomain to your new domain blinklist:How to redirect your subdomain to your new domain furl:How to redirect your subdomain to your new domain reddit:How to redirect your subdomain to your new domain fark:How to redirect your subdomain to your new domain blogmarks:How to redirect your subdomain to your new domain Y!:How to redirect your subdomain to your new domain smarking:How to redirect your subdomain to your new domain magnolia:How to redirect your subdomain to your new domain segnalo:How to redirect your subdomain to your new domain

Probably related entries:

Make a Comment

Make A Comment: ( 3 so far )

blockquote and a tags work here.

3 Responses to “How to redirect your subdomain to your new domain”

RSS Feed for TechLogs Comments RSS Feed

Salam bang,
aku rasa ko kena tambah sket ko nyer rules tu, sebab rules ko akan redirect domain tu ke TLD…
so contoh…
http://www.korokmu.eizil.com/2007/03/23/how-to-redirect-your-subdomain-to-your-new-domain/
patut dia akan gi ke
http://www.techlogs.net/2007/03/23/how-to-redirect-your-subdomain-to-your-new-domain/
baru cun… so nanti ko tambah aa rules tu erk… :) sekadar cadangan jer…
okay… slamat²

Eizil
March 23rd, 2007

Owh, tak sedar. tapi nak buat macam mane ye?

korokmu
March 25th, 2007

dah ok da. ade koflik dengan rules lain agaknye.

korokmu
August 20th, 2008

Where's The Comment Form?

Sponsored

Random post

Increase Your Blog Traffic by Helping Others Increase their Traffic

Yes, it is a brilliant idea. At Blogem-up.com, you can buy a big square spot from USD1!. The initial value of each spot is USD10. Once an advertiser bought this spot, the value of the spot will become USD9. After the value of the spot become USD1 and somebody buy it, the value will be [...]


Read more...

RSS

Topics

Links

Blogroll

Misc

Liked it here?
Why not subscribe to this site feed? You can get automatic updates for free! Click here to subscribe