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. Proper method of consolidating https to http?

    Proper method of consolidating https to http?

    Technical SEO Issues
    2 2 1.8k
    • 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.
    • seagreen
      seagreen last edited by

      A client has an application area of the site (a directory) that has a form and needs to be secured with ssl.  The vast majority of the site is static, and does not need to be secured.  We have experienced situations where a visitor navigates the site as https which then throws security errors.  We want to keep static visitors on http; (and crawlers) and only have visits to the secure area display as ssl.  How is this best accomplished?

      Our developer wants to add a rule to the global configuration file in php that uses a 301 redirect to ensure static pages are accessed as http, and the secure directory is accessed as https.  Is the the proper protocol?  Are there any SEO considerations we should make?

      Thanks.

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

        Hi there,

        I would agree with your developer in using 301 redirects to ensure all static pages resolve only to the HTTP version while the secure pages resolve only to HTTPS.

        As for SEO, the search engines should follow these 301 redirects just fine, but it might also be a good idea to designate canonical URLs to tell the search engines only to index non-HTTPS pages just to be safe. The PHP code below automatically detects which version of the page is being accessed and automatically inserts a canonical tag to tell the search engines to only index the non-HTTPS versions.

        $currenturl= $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];

        //Check if it is using the secure https port which is 443
        if ($_SERVER["SERVER_PORT"] == “443″) {

        //connected to secure port, formulate the http canonical version
        $canonicalversion=”http://”.$currenturl;

        //echo the canonical version to the HTML as link rel canonical tag

        echo ‘’;
        }
        ?>

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        • Proper 301 redirect code for http to https
          TimHolmes
          TimHolmes
          0
          2
          23.4k

        • 301 Redirecting http to https
          Heydarian
          Heydarian
          0
          3
          663

        • What is the proper way to handle a fully https site transition from an http site
          HiveDigitalInc
          HiveDigitalInc
          0
          7
          89

        • Do you still loose 15% of value of inbound links when you redirect your site from http to https (so all inbound links to http are being redirected to https version)?
          LoganRay
          LoganRay
          0
          5
          74

        • Bigcommerce only allows us to have https for our store only, not the other pages on our site, so we have a mix of https and http, how is this hurting us and what's the best way to fix?
          aarongray
          aarongray
          0
          2
          178

        • Http to https - Copy Disavow?
          twitime
          twitime
          0
          4
          964

        • Switching to HTTPS from HTTP
          DennisSeymour
          DennisSeymour
          0
          3
          82

        • I have a site that has both http:// and https:// versions indexed, e.g. https://www.homepage.com/ and http://www.homepage.com/. How do I de-index the https// versions without losing the link juice that is going to the https://homepage.com/ pages?
          fthead9
          fthead9
          0
          3
          729

        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