My blogs are hosted on hostmonster and run on the WordPress platform. About 8 months ago, before I started blogging (finally!), I researched the pros and cons of various blogging platforms and tried out a few before selecting WordPress. So far, it’s been a great experience blogging using WordPress.
When I first started blogging, I registered the domain www.mrkips.com for my blogs. A few days ago, I registered another domain www.cybergav.in (a domain name which relates more to me and my ethnic roots). Yesterday, I finally switched my blogs from mrkips.com to cybergav.in and although the WordPress forums provide adequate information on how to do this task, I’m describing the process below which worked for me.
Let’s say you host your WordPress blog on hostmonster (process should be applicable to most hosting platforms) and wish to switch its domain from www.abc.com to www.xyz.com.
STEP 1: Register your domain and specify DNS servers
Register your new domain xyz.com after doing a bit of research and choosing an appropriate registrar (typical factors in choosing a registrar are cost, DNS management facility, Domain privacy (not available for all ccTLDs) and customer service – there are other goodies usually provided such as web forwarding, domain cloaking, etc.). When you select your registrar and register your domain, you must ensure that you use the registrar’s DNS management facility to configure the DNS servers belonging to your hosting platform. For example, for my domain, I configured my DNS servers as ns1.hostmonster.com and ns2.hostmonster.com. It is this DNS configuration that will ensure the required DNS A records are inserted in your hosting platform’s DNS servers to map your domain name with your hosting account (and consequently your website).
STEP 2: Verify your domain
My domain was registered in less than half an hour and I could verify its registration using a WHOIS search. If your domain name registrar and hosting provider are different companies, then ensure you inform your hosting provider after registering your domain. My hosting provider switched my primary domain to cybergav.in and I configured mrkips.com as a parked domain. Now before you migrate your website to your new domain, you must verify if your new domain is resolvable. To do this, you can either use any one of the myriad websites available (e.g. www.who.is ) or use the nslookup utility as follows:
# # SYNTAX 1: nslookup <domain name> # c:\>nslookup cybergav.in Server: BeBox.config Address: 192.168.1.130:53 Non-authoritative answer: Name: cybergav.in Address: 66.147.240.162 # # SYNTAX 2: nslookup <domain name> <dns server> # c:\>nslookup cybergav.in ns1.hostmonster.com Server: UnKnown Address: 74.220.195.131:53 Name: cybergav.in Address: 66.147.240.162 |
STEP 3: Change your WordPress blog’s domain name
(i) Define the WP_HOMEand WP_SITEURLvariables: This is required in order to give your WordPress blog its new domain name and access its Administration console (wp-admin). You do this by adding the following in wp-config.php (in the root of your WordPress installation):
define('WP_HOME','http://www.xyz.com'); define('WP_SITEURL','http://www.xyz.com'); |
(ii) Update your blog’s WordPress database by ensuring that URLs containing your old domain reflect your new domain as per the following example :
UPDATE wp_posts SET guid = REPLACE ( guid, 'abc.com', 'xyz.com'); UPDATE wp_posts SET post_content = REPLACE ( post_content, 'abc.com', 'xyz.com'); |
STEP 4: Redirect all traffic from your old domain to your new domain
After getting your blog up and running with your new domain name, you must redirect all traffic arriving at your old domain to your new domain to ensure your users and search engines know that you’ve switched domains. You must use a HTTP 301 Redirect method (permanent move) so that search engines and browsers will recognize your blog’s new home. You can configure this redirect by either using your hosting provider’s management tools or configuring .htaccess (Apache web server) as per the following example:
RewriteEngine On RewriteCond %{HTTP_HOST} ^abc.com$ [OR] RewriteCond %{HTTP_HOST} ^www.abc.com$ RewriteRule ^/?$ "http\:\/\/www\.xyz\.com\/" [R=301,L] |