I’m sitting here looking at the domain to this blog http://codewithintent.com/
it does not look pretty it does not have the glowing https
looking back at me it’ s a plain boring domain name. I have been wanting to change the domain name with a www prefix.
In this blog post, I will show you how to accomplish three simple things that could improve your ranking depending on who you ask.
1. Set preferred domain name with Webmaster Tools
2. Setup www
as an alias to your domain name and
3. Redirect all your old traffic to the new domain name
Is it worth it, though? Should you go through the headache of setting all these things up? What will be the ROI for this investment? Most importantly is this something you should do yourself? This is all valid questions.
Instead of me telling you why to add the www prefix or not let’s just ask google and see what they recommend.
The preferred domain is the version that you want to be used for your site in the search results. – Alphabet Corporation
This is not helpful at all! What are you trying to say google? What do you mean by “preferred domain”?
You will need to have an account with Webmasters Tools at google.
1. Set preferred domain name with Webmaster Tools
Here you will have the option to set your “preferred domain” name as follows.
First, make sure that you have both properties registered www
and non www
. If you do not have both properties registered with google use the ADD PROPERTY button and verify that you own both subdomains.
Now you will have both domains setup with Webmasters.
Let’s now setup the last configuration to let google know about our new “preferred domain” name by selecting the www
prefix domain name and using the gear option to open up the menu and selecting Site Settings
.
Last part is to let google know about your new decision and selecting the new option Display URLs as www.domain.com
and click on save.
2. Setup www
as an alias to your domain name and
In your DNS provider, you are going to want to create a cname record to know about your new subdomain.
Now your server needs to know about this changes I’m using apache so your configuration might look like this.
Now you will need to restart apache to for this new changes to take effect.
sudo service apache2 reload
3. Redirect all your old traffic to the new domain name
The moment of truth, will you go all in on www
? For me, it does not really matter I don’t have to pick one or the other I can support both. For the search engines, it does matter. It has to be one or the other or neither.
Google recommends that you redirect all your users to the new preferred domain with a 301 redirect. If you decide to go down this path I would recommend you to create an A
record instead of a CNAME
that way you can avoid double lookups with the DNS server.
That’s all there is to it.
See you in the next blog post.
Rick H.
I always had a passion for the field of STEM (Science, Technology, Engineering, and Math) and I knew I wanted to do something to make a difference in the world. I just didn’t know where to start. I was an immigrant in a new country, grew up in a tough environment, and wasn’t sure how… Read More