Title: How to fix redirects http &gt; https
Last modified: April 26, 2019

---

# How to fix redirects http > https

 *  Resolved [because i](https://wordpress.org/support/users/matrixpoland/)
 * (@matrixpoland)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/how-to-fix-redirects-http-https/)
 * As you can see because of 301 redirect (don’t know where it is set) to https 
   this app shows 0 shares and likes. On http version of this share link it has 
   about 89.
 * How to change that?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fhow-to-fix-redirects-http-https%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Plugin Author [Rank Math SEO](https://wordpress.org/support/users/rankmath/)
 * (@rankmath)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/how-to-fix-redirects-http-https/#post-11475576)
 * Hello [@matrixpoland](https://wordpress.org/support/users/matrixpoland/)
 * Thank you for contacting the support.
 * This is not an issue related to the plugin but here are a few resources which
   should help you:
    [https://cognitiveseo.com/blog/13431/recover-facebook-shares-https/](https://cognitiveseo.com/blog/13431/recover-facebook-shares-https/)
   and [https://really-simple-ssl.com/knowledge-base/how-to-recover-facebook-likes-after-moving-to-httpsssl/](https://really-simple-ssl.com/knowledge-base/how-to-recover-facebook-likes-after-moving-to-httpsssl/)
 * Hope that helps.
 *  Thread Starter [because i](https://wordpress.org/support/users/matrixpoland/)
 * (@matrixpoland)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/how-to-fix-redirects-http-https/#post-11475601)
 * Redirects, meta tags for it and canonical links are not related to Rank Math?
 * > [View post on imgur.com](https://imgur.com/Wdq11Bs)
 * Where change what i marked?
 *  Thread Starter [because i](https://wordpress.org/support/users/matrixpoland/)
 * (@matrixpoland)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/how-to-fix-redirects-http-https/#post-11475934)
 * I add that i changed many options in Rank Math
 * eg
    Redirect Orphan Media
 * from http to https
 * and others.
    ==== From your links:
 *     ```
       3. Update rel=”canonical”
   
   
   
       The previous step left you with all your shares to zero. By now you might be thinking how these steps are really helping you in getting your shares back. Bear with me as you are closer and closer to getting your social shares count. 
   
   
   
       The next step in solving the social share loss situation is to alter the content you are showing to Facebook’s crawler. What you need to do, for Facebook only, is to make sure that the rel= canonical tag is placed, but not the way you would think of. It’s exactly the other way around: you need to make the http version the preferred one, just like in the example below: 
   
   
   
       <link rel="canonical" href="https://cognitiveseo.com/blog/11813/ways-of-repurposing-content/" />
       1
   
       <link rel="canonical" href="https://cognitiveseo.com/blog/11813/ways-of-repurposing-content/" />
   
   
   
       has to be
   
   
   
       <link rel="canonical" href="http://cognitiveseo.com/blog/11813/ways-of-repurposing-content/" />
       1
   
       <link rel="canonical" href="http://cognitiveseo.com/blog/11813/ways-of-repurposing-content/" />
       ```
   
 * How to change canonical for all URLS?
    -  This reply was modified 7 years, 1 month ago by [because i](https://wordpress.org/support/users/matrixpoland/).
 *  Plugin Author [Rank Math SEO](https://wordpress.org/support/users/rankmath/)
 * (@rankmath)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/how-to-fix-redirects-http-https/#post-11487689)
 * Hello [@matrixpoland](https://wordpress.org/support/users/matrixpoland/)
 * You can use the following filter to modify your canonical URLs to use HTTPS:
 *     ```
       add_filter( 'rank_math/frontend/canonical', function( $canonical ) {
           $canonical = preg_replace( '/^https:/i', 'http:', $canonical );
           return $canonical;
       });
       ```
   
 * Or the other way around. Hope that helps. Thank you.
 *  Thread Starter [because i](https://wordpress.org/support/users/matrixpoland/)
 * (@matrixpoland)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/how-to-fix-redirects-http-https/#post-11488464)
 * This is the code for functions.php?
 *  Plugin Author [Rank Math SEO](https://wordpress.org/support/users/rankmath/)
 * (@rankmath)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/how-to-fix-redirects-http-https/#post-11499722)
 * Hello [@matrixpoland](https://wordpress.org/support/users/matrixpoland/)
 * Yes, please put this code in the theme’s functions.php file after taking the 
   backup of your site.
 * Hope that helps. Thank you.
 *  Thread Starter [because i](https://wordpress.org/support/users/matrixpoland/)
 * (@matrixpoland)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/how-to-fix-redirects-http-https/#post-11525581)
 * [https://developers.facebook.com/tools/debug/sharing/?q=http%3A%2F%2Fswiadomosc-zwiazkow.pl%2Fjak-kobiety-rujnuja-zwiazki-starajac-sie-dominowac-nad-mezczyznami%2F](https://developers.facebook.com/tools/debug/sharing/?q=http%3A%2F%2Fswiadomosc-zwiazkow.pl%2Fjak-kobiety-rujnuja-zwiazki-starajac-sie-dominowac-nad-mezczyznami%2F)
 *  Circular Redirect
    We could not resolve the canonical URL because the redirect
   path contained a cycle.
 * This warning is after copying this code to functions.php
 * Sharing debugger still shows only https likes and shares. No http counts
    -  This reply was modified 7 years, 1 month ago by [because i](https://wordpress.org/support/users/matrixpoland/).
 *  Plugin Author [Rank Math SEO](https://wordpress.org/support/users/rankmath/)
 * (@rankmath)
 * [7 years ago](https://wordpress.org/support/topic/how-to-fix-redirects-http-https/#post-11532140)
 * Hello [@matrixpoland](https://wordpress.org/support/users/matrixpoland/)
 * The redirect is happening because Facebook follows the URL it finds in the `rel
   ="canonical"` tag or in the `og:url` tag. Here’s a breakdown of the requests 
   Facebook makes:
    1. It fetches the `http` version of the page, as instructed.
   2. Your server responds with 301 redirect to the `https` version. 3. Facebook
   fetches the `https` version, where it finds the canonical tag with the `http`
   URL in it. 4. We’re back to step 1.
 * The only way to solve this issue is to remove the HTTP to HTTPS redirection on
   your site, however, we would advise against doing that, because it might result
   in duplicate content issues.
 * Hope that helps.
 *  Thread Starter [because i](https://wordpress.org/support/users/matrixpoland/)
 * (@matrixpoland)
 * [7 years ago](https://wordpress.org/support/topic/how-to-fix-redirects-http-https/#post-11535372)
 * Actually situation is this
 * `https://developers.facebook.com/tools/debug/sharing/?q=http%3A%2F%2Fswiadomosc-
   zwiazkow.pl%2Fwybor-kobiety-zycia-raport-dla-przebudzonego-mezczyzny%2F`
 * Here it shows 0 likes and shares.
 *  The provided value for ‘og:url’ might be incorrect.
    The provided property ‘
   og:url’ (‘[https://swiadomosc-zwiazkow.pl/wybor-kobiety-zycia-raport-dla-przebudzonego-mezczyzny/&#8217](https://swiadomosc-zwiazkow.pl/wybor-kobiety-zycia-raport-dla-przebudzonego-mezczyzny/&#8217);)
   does not represent the input URL. You can safely ignore this message after double
   checking the provided value
 * `https://swiadomosc-zwiazkow.pl/wybor-kobiety-zycia-raport-dla-przebudzonego-
   mezczyzny/`
 * And here is 30 or 60
 *  Plugin Author [Rank Math SEO](https://wordpress.org/support/users/rankmath/)
 * (@rankmath)
 * [7 years ago](https://wordpress.org/support/topic/how-to-fix-redirects-http-https/#post-11536701)
 * Hello,
 * The difference is possibly due to the internal cache of the sharing plugin you
   are using, WP Socializer. It updates the like count intermittently, and it is
   possible that when it fetches the count from Facebook, it ignores the response
   when it is “zero like”, so it may only update when your new `https` version gets
   its first like.
 * We would advise contacting the author of the WP Socializer plugin about the discrepancy
   between the numbers.
 * Hope that helps.

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘How to fix redirects http > https’ is closed to new replies.

 * ![](https://ps.w.org/seo-by-rank-math/assets/icon.svg?rev=3438330)
 * [Rank Math SEO – AI SEO Tools to Dominate SEO Rankings](https://wordpress.org/plugins/seo-by-rank-math/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/seo-by-rank-math/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/seo-by-rank-math/)
 * [Active Topics](https://wordpress.org/support/plugin/seo-by-rank-math/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/seo-by-rank-math/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/seo-by-rank-math/reviews/)

 * 10 replies
 * 2 participants
 * Last reply from: [Rank Math SEO](https://wordpress.org/support/users/rankmath/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/how-to-fix-redirects-http-https/#post-11536701)
 * Status: resolved