Title: Blog URL identified as HTTPS by mistake &#8211; Solution
Last modified: August 24, 2016

---

# Blog URL identified as HTTPS by mistake – Solution

 *  Resolved [Mohamed_Meligy](https://wordpress.org/support/users/mohamed_meligy/)
 * (@mohamed_meligy)
 * [10 years, 12 months ago](https://wordpress.org/support/topic/blog-url-identified-as-https-by-mistake/)
 * Hello,
 * I had a problem when the post links in my shares (all services) were always HTTPS
   links, although my blog is served via HTTP only (no SSL/TLS).
 * The only interesting thing about my setup I can think of is that I run my blog
   on IIS 8 on Windows 2012 R2.
 * I don’t know PHP really but I think I know where the error is and how to fix 
   it.
 * In the file: OSDSocialShare.php
 * There is a line that looks like:
 *     ```
       $protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != '') ? "https://" : "http://";
       ```
   
 * I looked at StackOverflow, and found that this answer:
    [http://stackoverflow.com/a/2886224/146656](http://stackoverflow.com/a/2886224/146656)
 * I changed the code accordingly to be:
 *     ```
       $isHttps =  (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443;
       $protocol = $isHttps? "https://" : "http://";
       ```
   
 * I’m guessing the key part is checking for ‘off’ not checking for `443`, but I
   didn’t test it to be honest.
 * Can you please update the check to the one suggested here so other people don’t
   fall into the same problem?
 * Thanks a lot.
 * [https://wordpress.org/plugins/osd-social-media-sharing/](https://wordpress.org/plugins/osd-social-media-sharing/)

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

 *  Plugin Author [osdwebdev](https://wordpress.org/support/users/osdwebdev/)
 * (@osdwebdev)
 * [10 years, 12 months ago](https://wordpress.org/support/topic/blog-url-identified-as-https-by-mistake/#post-6154113)
 * Mohamed_Meligy,
 * You are entirely correct. IIS does have some weird behavior regarding how it 
   fills out the $_SERVER superglobal in PHP. I have added in the fix. Let me know
   if you need anything else. Good ratings appreciated!
 *  Thread Starter [Mohamed_Meligy](https://wordpress.org/support/users/mohamed_meligy/)
 * (@mohamed_meligy)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/blog-url-identified-as-https-by-mistake/#post-6154224)
 * Oops. I forgot to report the result till I noticed I have the tab open!
 * Your update worked very well. Thanks a lot 🙂
 *  [MattRaynerDBS](https://wordpress.org/support/users/mattraynerdbs/)
 * (@mattraynerdbs)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/blog-url-identified-as-https-by-mistake/#post-6154299)
 * Looks as though part of the fix has been reverted in one of the latest plugin
   updates.
 * The plugin no longer checks for ‘off’ in the HTTPS server variable.
 *  Plugin Author [osdwebdev](https://wordpress.org/support/users/osdwebdev/)
 * (@osdwebdev)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/blog-url-identified-as-https-by-mistake/#post-6154300)
 * MattRaynerDBS,
 * Thank you very much for noticing this. We had some trouble with our repo and 
   lost the last revision without noticing it. I have pushed a new fix and all should
   be working now. Thank you again.
 *  [MattRaynerDBS](https://wordpress.org/support/users/mattraynerdbs/)
 * (@mattraynerdbs)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/blog-url-identified-as-https-by-mistake/#post-6154301)
 * Thank you very much for the quick fix!

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

The topic ‘Blog URL identified as HTTPS by mistake – Solution’ is closed to new 
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/osd-social-media-sharing_964078.svg)
 * [OSD Social Media Sharing](https://wordpress.org/plugins/osd-social-media-sharing/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/osd-social-media-sharing/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/osd-social-media-sharing/)
 * [Active Topics](https://wordpress.org/support/plugin/osd-social-media-sharing/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/osd-social-media-sharing/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/osd-social-media-sharing/reviews/)

## Tags

 * [HTTPS](https://wordpress.org/support/topic-tag/https/)
 * [iis](https://wordpress.org/support/topic-tag/iis/)
 * [windows](https://wordpress.org/support/topic-tag/windows/)

 * 5 replies
 * 3 participants
 * Last reply from: [MattRaynerDBS](https://wordpress.org/support/users/mattraynerdbs/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/blog-url-identified-as-https-by-mistake/#post-6154301)
 * Status: resolved