How to stop Google indexing both www. and also no - www variations of my internet site
When I do a search of my website in Google it reveals both:
mydomain.com
www.mydomain.com
In my.htaccess documents I included code to reroute the non - www variation to the www variation, yet both variations are still receiving Google is search results.
Exists anyhow to have Google just show the www variation?
First, I wish you place a correct 301 redirect for any kind of web page in your htaccess.
If several of your web pages call for parameters, like example.com/?p = 20, after that you require to make use of mod_rewrite with [R = 301 ] as opposed to the less complicated mod_alias Redirect instruction in your htaccess. Additionally, till Google Bot returns and also indexes, it will certainly not upgrade the Google index.
Second, it will certainly spend some time for Google to reindex your internet site. You can attempt and also send a correct sitemap (sitemap.xml) to google using Google Webmaster Tools yet it still could spend some time.
Third, you could intend to make use of a rel=canonical tag on your web pages - specifically if your redirect is not functioning yet to hint Google for correct indexing of your web pages.
A little of an apart, yet why do you still intend to make use of the www domain name? It is no more essential and also includes even more bloat to your url. Look into the no - www task for even more details.
As to your trouble, offer Google at some time to reindex your website and also enjoy that your website is still turning up two times in the outcomes.
In enhancement to Evgeny is great factors, it needs to be kept in mind that the Google Webmaster's tool permits you to define a recommended domain name, either with or without the www prefixes. Google is description of this alternative adheres to:
The recommended domain name is the one that you would certainly such as made use of to index your website is web pages. If you define your recommended domain name as
http://www.example.com
and also we locate a link to your website that is formatted ashttp://example.com
, we'll deal with that link as if it washttp://www.example.com
. On top of that, we'll take your choice right into account when presenting URLs in our search results. It might spend some time for adjustments to be mirrored in our index.
You'll locate the alternative under "Site Configurations \ Settings".
Related questions