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. Moz Local
    4. Http canonical .htaccess

    Http canonical .htaccess

    Moz Local
    8 2 861
    • 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.
    • gimmick
      gimmick last edited by

      Hi,

      I get a warning that my webpage is showing duplicate content with https address even though I haven't purchased any SSL certificate.

      However, there should be a easy way to fix this within .htaccess file by using rel canonical tag. But I didn't find any information how to make a canonical redirect in .htaccess to http from https over the internet, so I'm hoping someone here has that information.

      Any information would be highly appreciated.

      Kim

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

        You wouldn't be setting up the canonicals in the htaccess file so that may be where you're hitting a road block.  If you saw references to the htaccess file that would likely be in reference to setting up redirects from https to http to eliminate the error.    What tech is your site built on?  With that I'll probably be able to point you in the right direction.

        That said, If you do just want to setup the redirection via htaccess you should be able to use the following code:

        <code>RewriteEngine On
        RewriteCond %{HTTPS} on
        RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI}</code>
        

        Note: the code doesn't come out right here so you'll want to visit the link below to see how it should be formatted.

        I need to note that I haven't had a chance to test it but it does look right.  I'm far more familiar with the code to go the other way.  The initial source of the code (credit where it's due) is at http://stackoverflow.com/questions/8371/how-do-you-redirect-https-to-http.

        Hope that helps. 🙂

        Dave

        gimmick 1 Reply Last reply Reply Quote 0
        • gimmick
          gimmick @BeanstalkIM last edited by

          Thank you for your reply Dave.

          I explain little further: I presume that my site www.kimwist.com should redirect to http when attamted to access via https, because I don't have a SSL certificate for the site.

          However, https takes to a page the server administration has set up, that says my site will be shown here in the near future. This is just like I just purchased the domain and have not uploaded any site to it yet.

          I should probably contact the host provider and ask about this, but I also read that this is a common problem and should be fixed with the "rel canonical tag" in .htaccess file, that is the reason I asked about it here.

          The .htaccess code that you provided shuts the server and creates an internal error, so something else should be implemented.

          The whole issue is of course because https is considered duplicate content and I simply want https to redirect to http, but it seems to be quite difficult to accomplish.

          Thanks, Kim

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

            Sorry about that code.  Ordinarily I'd have had a chance to test it but didn't have a test site ready for that type of testing.

            Thinking about it further, an actual redirect won't work due challenge/response on the certificate not being installed.  If you load the site in a new browser you'll see what I'm talking about.

            If the site were mine (or a clients of course) I'd recommend getting a certificate setup and redirecting the whole thing to HTTPS now.  If you don't want to do that the certificate will at least light up the HTTPS site directly (i.e. without the insecure warning) which will allow it to be redirected properly.

            That said ... you do have the canonical tags on the pages properly so a duplicate content warning will be a false positive in that the content is indeed duplicated but Google knows that the HTTPS is the primary source as far as I can tell.  Your site is going into a redirect loop on HTTPS so I can't double check but it appears as though it should from the way it's displaying in the source.  Happy to double check after the loop is corrected.

            Dave

            gimmick 1 Reply Last reply Reply Quote 1
            • gimmick
              gimmick @BeanstalkIM last edited by

              Hi again Dave and thank you taking time to look into this problem!

              I contacted my service provider finally and they installed a free self signed certificate on my server which took care of the problem.

              The other option would have been, just like you suggested, to buy a SSL certificate for the site. But this is a small site and I'm not sure if it would help in rankings or be in significant in any other way.

              What do you mean by "your site is going into a redirect loop on HTTPS"?

              Should something be done about that?

              Kim

              BeanstalkIM 1 Reply Last reply Reply Quote 0
              • BeanstalkIM
                BeanstalkIM @gimmick last edited by

                When I visit https://www.kimwist.com/ it's spinning into a loop and doesn't display the site.  You can check it at http://www.redirect-checker.org/ and see what I'm talking about.  It looks like it's 301ing to itself.  I'm wondering if you've set a redirection to go to https that's trying to do it if the URL itself is https in which case you'd want to switch it to point to http.

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

                  Thanks Dave!

                  I had a attempt to redirect https to http in my .htaccess file. I removed it and now everything seem to be ok.

                  However, I get a 200 ok response from the redirect checker. If I rememer correctly this is not what is should be, although it says all is fine. If www to non www and all other redirects are in place, I think the response should have been something else... not quite sure though about this.

                  BeanstalkIM 1 Reply Last reply Reply Quote 0
                  • BeanstalkIM
                    BeanstalkIM @gimmick last edited by

                    A 200 is perfect (it just means "OK").  I double-checked and your canonicals' are pointing to the http version which is also what you want if you're not doing a 301.  Some tools will still show a duplication even with the canonicals but rest assured ... Google knows what's what. 🙂

                    Best of luck to you as you proceed forward and glad it worked out.

                    Regards.

                    Dave

                    1 Reply Last reply Reply Quote 1
                    • 1 / 1
                    • First post
                      Last post
                    • Why my website DA stuck at one place?
                      abpaksazanacc
                      abpaksazanacc
                      0
                      6
                      55

                    • DA Not Increasing
                      samantha.chapman
                      samantha.chapman
                      0
                      4
                      36

                    • Backlinks are not indexed in moz
                      lauren.s
                      lauren.s
                      0
                      3
                      47

                    • When will it be possible to check your local listings for Australia?
                      eli.myers
                      eli.myers
                      0
                      2
                      72

                    • Moz local & Rich Data in bi-lingual markets
                      0
                      1
                      18

                    • Moz not working
                      samantha.chapman
                      samantha.chapman
                      1
                      2
                      43

                    • Moz Listing Paused
                      fatetmpwcosl
                      fatetmpwcosl
                      0
                      6
                      83

                    • Unable to change http to https in Local Moz?
                      samantha.chapman
                      samantha.chapman
                      0
                      2
                      45

                    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