Jump to content

Google is indexing my pages as http and https


graysonrobb

Recommended Posts

I have noticed that Google is indexing all my pages as http and https. Last week I accidentally set my entire store to be set as SSL for a few days. Is this what caused this to happen? Is there anything I can do with the robots.txt or .htaccess file to fix this problem? Any help would be much appreciated.  

Link to comment
Share on other sites

Your mileage may vary, but here's what I did and I have no duplicate content issues with Google.

Back Office -> SEO & URLs -> Set Up URLs -> Redirect to the Canonical URL -> 301

Follow instructions for Google Webmaster Tools for a preferred URL here:
https://support.google.com/webmasters/answer/44231?hl=en

Set Default URL in Google analytics for either http or https.  Google Analytics -> Admin -> Property Settings -> Default URL

And then check that your sitemap is using the settings that you want, i.e., https vs. http and www.mysite.com vs mysite.com

And that in Back Office -> SEO & URLs -> Set Up URLs -> Set Up Shop URL you are using whichever of the www.mysite.com or mysite.com options you have everywhere else

Link to comment
Share on other sites

Thank you.  I have already set up as you described. I still have lots of 404 errors and I need to correct those errors by redirecting them individually. I still waiting and hope someone will give me some tips how to and where can I add some codes.

I have added the following to .htaccess  but didn't work.  

   Options +FollowSymLinks

   RewriteEngine On
   RewriteCond %{HTTPS_HOST} ^mydomain.com$ 
   RewriteRule ^(.*)$ http\:\/\/mydomain\.co\.uk\page [R=301,L]
Link to comment
Share on other sites

Okay I finally got mine all figured out. I basically just had some configuration errors in many different places. I’ll tell you how I have my site configured and hopefully it will help out the next person.

 

In my DNS I have www.mysite.com forwarding to mysite.com. However this didn’t automatically create a 301 redirect. So I opened up my .htaccess and added:
 

RewriteEngine On

RewriteCond %{HTTP_HOST} !^mysite.com$

RewriteRule (.*) http://mysite.com/$1 [R=301,L]

 

This creates a 301 redirect for all pages www to non-www.

 

Then it’s important to make sure you go to:
Back Office -> SEO & URLs -> Set Up URLs -> Redirect to the Canonical URL (Set that to yes.) Then scroll down to ‘Set Shop URL’ and make sure you have yoursite.com (no www) set for Shop domain and SSL domain.

 

Now go to your Google Sitemap module (make sure it is up to date!) and click Configure. Go through and make sure you have checked the boxes for EVERYTHING that you don’t want to be included on your sitemap. https://mysite.com was showing up on my sitemap and that was a major problem. I checked the [index] box and had that removed.

 

Next you need to set your preferred domain in your Google Webmaster Tools account. You can do so by following these instructions: https://support.google.com/webmasters/answer/44231?hl=en

 

After that you need to Set Default URL in Google analytics for either http/https and www/non-www. That can be found in Google Analytics -> Admin -> Property Settings -> Default URL

 

After doing all of these things I went back into my Google Sitemap module, generated a new sitemap and did a ctrl + f  to look for any pages that were incorrectly https. Luckily I didn’t find anymore and everything seems to now be working properly. Lastly I resubmitted my sitemap to Google Webmaster Tools.

 

Thanks to mikewra for all the suggestions. I hope this can help the next person.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...