How to redirect your subdomain to your new domain
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.
-
Options +FollowSymLinks
-
RewriteEngine on
-
-
RewriteCond %{HTTP_HOST} !^www.domain.com [NC]
-
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
Probably related entries:
- Get a free domain name If you badly need a domain name but cannot afford it, you can have a look at this
- How to redirect your WP Feed to Feedburner’s Feed Feedburner is an excellent feed service, which allows you to track your feed subscribers. After you have created
- Creative domain names Real companies, unfortunate domain names: * Pen Island - penisland.com * Amgen
- Yahoo Domain After offering domains at $1.99/year and $2.99/year, Yahoo is now offering domain at $4.98/year up to 5 years
- GMX Freemail gives me spams after registration GMX (Global Message eXchange) is a popular free email provider in Germany. I've made my account with GMX,
Make A Comment: ( 3 so far )
3 Responses to “How to redirect your subdomain to your new domain”
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

















