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. On-Page / Site Optimization
    4. Redirecting https pages

    Redirecting https pages

    On-Page / Site Optimization
    4 4 118
    • 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.
    • HiddenPeak
      HiddenPeak last edited by

      If I add 301 redirects from the https versions of the root domain to the http:www.website.com (canonical version), will this prevent users from being able to access the https version? I believe the https version is only accessed once users log into the site.

      Thank you!

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

        It is going to be a little bit more difficult than that. Unless you have a wildcard certificate your ssl certificate is not good for sub domains. www.site.com is considered a sub domain of site.com. That being said, I would use url rewriting to handle the problem. Here is a small example of what you could use.

        Rewrite Rules for site.com

        RewriteEngine On
        RewriteBase /

        Redirect from example.com to www.site.com

        RewriteCond %{HTTP_HOST} ^site.com [NC]
        RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

        Turn SSL on for payments

        RewriteCond %{HTTPS} off
        RewriteCond %{SCRIPT_FILENAME} /payments.php [NC]
        RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]

        Turn SSL off everything but payments

        RewriteCond %{HTTPS} on
        RewriteCond %{SCRIPT_FILENAME} !/payments.php [NC]
        RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [R=301,L]

        You will have to enter the other pages that you want to be ssl too, this should get you started though.

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

          What you want to do is setup the redirect for all pages "except" those pages that you want to require a person to use the https.

          As an example on a site I work on, we have two areas /cart/ and /account/  that represent when someone is checking out or when they are logged into their account and want to update payment options, respectively.  You would exclude these folders from the https to http 301 redirect so that users could then use that part of the site in secure mode.The rest of the site you want to have the https 301 to http.    The reason you go through all this is that a http and https versions of the site, if spidered, would be considered duplicate content and you want to prevent that.

          The other part of this would be that you do not want the search engines (usually) to spider the shopping cart and user login sections of a site.  Nofollow noindex all links that lead to those pages and also put those folders in robots.txt - that will keep the bots out of there.

          One other thing. Make sure that your templates and content within the https sections of the site link out to the non https urls.  The 301 will help with this, but why link to the wrong URL anyway?

          All of that said.  If your site is one that you deal with highly sensitive information (medical, financial come to mind) then you may simply want to have the site run as https.   You would need to bulk up your server resources to handle this  as https can slow things down a little bit, but it can be done.

          1 Reply Last reply Reply Quote 1
          • MikeTek
            MikeTek last edited by

            To directly answer your question, Erin, a 301 redirect will indeed prevent users from accessing the https versions of your pages and is not the recommended approach.

            Is there a reason you want to prevent users/search engines from accessing the https versions of your pages?

            Simply ensuring that all links within the site navigation point to http versions, and setting a rel=canonical on all https versions back to the http versions, should do the trick.

            Best,
            Mike

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            • Combining products - edit existing product page or 301 redirect to new page?
              hefazmarket91
              hefazmarket91
              0
              26
              166

            • Why are http and https pages showing different domain/page authorities?
              evolvingSEO
              evolvingSEO
              1
              4
              2.4k

            • Help with Temporary Redirects on Pages
              jeeyer
              jeeyer
              0
              5
              174

            • Which page to rank for a Keyword? Home Page or Deep Page?
              MoosaHemani
              MoosaHemani
              0
              14
              197

            • Can you 301 redirect to a page that has other pages 301 to it?
              Cyrus-Shepard
              Cyrus-Shepard
              0
              7
              363

            • Which redirect to use when redirecting to https page from http page
              AlanBleiweiss
              AlanBleiweiss
              0
              2
              302

            • If a site has https versions of every page, will the search engines view them as duplicate pages?
              AlanMosley
              AlanMosley
              0
              7
              520

            • Https and secure pages
              G-Force
              G-Force
              0
              2
              634

            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