2

I am working on a website redesign. When I uploaded my code in production, I didn't know I must make a redirect between www and non-www URL.

Since I have corrected that problem, Google has indexed both www and non-www URLs.

How can I tell google to unindex all www URLs and only reindex non-www URLs?

5
  • Google has a guide on its support pages for solving this issue. You should find all the info you need here: support.google.com/webmasters/answer/44231?hl=en. Commented Aug 11, 2016 at 13:04
  • thanks, I already configure my preferred domain, but when I renseign "site:domain.fr", the results show both www and non-www urls, is it normal ? Commented Aug 11, 2016 at 13:08
  • @AmaniteLaurine You need to give it time. Google won't update it's index overnight. Providing you have implemented the necessary then you just have to be patient. Assuming you have implemented a canonical 301 redirect, as mentioned in the linked article, then your users will get to the correct URL and search engines will get the message - eventually.
    – MrWhite
    Commented Aug 11, 2016 at 13:47
  • I implemented the redirection one mounth ago, is it normal that Google takes so much time or is it unusual ? (sorry I don't have many experience on indexing) Commented Aug 11, 2016 at 13:51
  • That is quite a while, but since this is a new site, Google's crawl rate could be low so any change in URL structure will be slow. When you say you've "corrected that problem" - you could add exactly what you have done to correct it... sitemap, 301 redirect, canonical meta tag, both properties added to GSC, preferred domain set in GSC, etc... so as we don't end up repeating ourselves. But I think "time" is going to be the big factor here.
    – MrWhite
    Commented Aug 11, 2016 at 13:55

2 Answers 2

2

As long as you've configured the redirect properly:

  1. You don't need to worry about the extra indexed pages, as there are no downsides for you.
  2. Google will slowly start removing the redirected pages. Depends on the traffic, this can take long months, from personal experience.
  3. As Edward suggested, you may use Google Webmaster Tools to set your preferred domain.

Make sure the redirect pages are 301 (permanent) and not 302 (temporary), you might want to use a redirect checker to make sure.

Good luck with the new design!

1
  • thanks a lot ! I'm not very experienced about indexing, I didn't know how long could take Google to index website. My redirection is 301 (already made the mistakes so I changed it to 301) Commented Aug 12, 2016 at 6:25
1

Herewith an example config from a working production Apache environment (/etc/httpd/ configuration folder) for PERMANENT (301) URL redirection.

Please note the first will redirect all traffic from http:// to https:// so remove if not needed.

RewriteEngine On

# Force HTTP -> HTTPS redirection on entire domain
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

## Redirect www to non-www permanently - both http and https
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1$1 [R=301,L]
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1$1 [R=301,L]
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.