The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Technical SEO Issues
    4. Correct Indexing problem

    Correct Indexing problem

    Technical SEO Issues
    4 2 499
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • kicksetc
      kicksetc last edited by

      I recently redirected an old site to a new site.  All the URLs were the same except the domain.  When I redirected them I failed to realize the new site had https enable on all pages.  I have noticed that Google is now indexing both the http and https version of pages in the results.  How can I fix this?  I am going to submit a sitemap but don't know if there is more I can do to get this fixed faster.

      1 Reply Last reply Reply Quote 0
      • donford
        donford last edited by

        If your site is running on https only, then a simple edit to your .htaccess file will correctly re-direct (301) any request for a http page to the correct https page.

        Sample Code:

        RewriteCond %{HTTPS} !=on

        RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]

        There are several ways to handle this, so you may also benefit from Searching ".htaccess 301 redirect http to https"

        Hope that helps.

        kicksetc 1 Reply Last reply Reply Quote 0
        • kicksetc
          kicksetc @donford last edited by

          My site should be running http on all pages except the checkout.  Would this work the opposite of what you have written and I can make a rule for the checkout to allow https?

          Thanks

          jared

          1 Reply Last reply Reply Quote 0
          • donford
            donford last edited by

            Okay I may have understood your original post differently then what you meant.

            So the case is you have HTTPS enabled, but Google is Indexing Both HTTP & HTTPS pages. However, you want them to only index the HTTP version. You are also running a cart or checkout which is only HTTPS which is likely not relevant to Google so I would recommend blocking those pages with robots.txt.

            I would recommend coding an IF statement to deal with duplicate indexing (https & http) & setting up a robots.txt file to prevent crawling pages that have no value and are there for customer use only.

            Something like this would work in php:

            _ 
            _if ( isset($_SERVER['HTTPS']) || (isset($SERVER['HTTPS']) && strtolower($SERVER['HTTPS'])) == 'on' ) {echo ''."\n";}
            else {echo ''."\n";}
            ?>

            _I'm not sure the code in asp since I rarely ever use Windows servers but you should be able to find that with Google.

            Then setup your robots.txt to block all urls that are specific to personal data like this: (Example)

            Disallow: /catalog/account.php
            Disallow: /catalog/account_edit.php
            Disallow: /catalog/account_history.php
            Disallow: /catalog/account_history_info.php
            Disallow: /catalog/account_password.php
            Disallow: /catalog/add_checkout_success.php
            Disallow: /catalog/address_book.php
            Disallow: /catalog/address_book_process.php
            Disallow: /catalog/checkout_confirmation.php
            Disallow: /catalog/checkout_payment.php
            Disallow: /catalog/checkout_process.php
            Disallow: /catalog/checkout_shipping.php
            Disallow: /catalog/checkout_shipping_address.php
            Disallow: /catalog/checkout_success.php
            Disallow: /catalog/cookie_usage.php
            Disallow: /catalog/create_account.php

            I hope that helps

            Don_

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            • Index problems, Part 2
              BlueprintMarketing
              BlueprintMarketing
              3
              8
              169

            • Index problems
              Happy-SEO
              Happy-SEO
              1
              9
              241

            • Having Problems to Index all URLs on Sitemap
              Martijn_Scheijbeler
              Martijn_Scheijbeler
              0
              4
              150

            • Indexing Problem - Most Weird yet I have seen?
              MattAntonino
              MattAntonino
              0
              4
              129

            • Site not indexing correctly
              AlanMosley
              AlanMosley
              0
              9
              335

            • Problem with indexed files before domain was purchased
              pwpaneuro
              pwpaneuro
              0
              5
              588

            Get started with Moz Pro!

            Unlock the power of advanced SEO tools and data-driven insights.

            Start my free trial
            Products
            • Moz Pro
            • Moz Local
            • Moz API
            • Moz Data
            • STAT
            • Product Updates
            Moz Solutions
            • SMB Solutions
            • Agency Solutions
            • Enterprise Solutions
            • Digital Marketers
            Free SEO Tools
            • Domain Authority Checker
            • Link Explorer
            • Keyword Explorer
            • Competitive Research
            • Brand Authority Checker
            • Local Citation Checker
            • MozBar Extension
            • MozCast
            Resources
            • Blog
            • SEO Learning Center
            • Help Hub
            • Beginner's Guide to SEO
            • How-to Guides
            • Moz Academy
            • API Docs
            About Moz
            • About
            • Team
            • Careers
            • Contact
            Why Moz
            • Case Studies
            • Testimonials
            Get Involved
            • Become an Affiliate
            • MozCon
            • Webinars
            • Practical Marketer Series
            • MozPod
            Connect with us

            Contact the Help team

            Join our newsletter
            Moz logo
            © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
            • Accessibility
            • Terms of Use
            • Privacy