Title: Multisite Language Switcher on WP Multisite
Last modified: February 23, 2017

---

# Multisite Language Switcher on WP Multisite

 *  Resolved [peterbisset](https://wordpress.org/support/users/peterbisset/)
 * (@peterbisset)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/multisite-language-switcher-on-wp-multisite/)
 * Hello, firstly great plugin! I have recently upgraded one of my multisite domains
   to SSL and everything works fine except the links to the other sites in my network
   through the Multisite Language Switcher are now all https:// as well. The problem
   is the other sites are on http:// rather than https:// and therefore the links
   don’t work. On all of the other http:// sites the links work fine it’s just on
   the https:// site they point to the wrong url. Any ideas how I could resolve 
   this?

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

 *  Plugin Contributor [Rogier Lankhorst](https://wordpress.org/support/users/rogierlankhorst/)
 * (@rogierlankhorst)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/multisite-language-switcher-on-wp-multisite/#post-8841764)
 * Hi,
 * The problem seems to be that WordPress decides all home_urls have to be SSL once
   it is on an SSL page.
 * I’ve run into this same issue when on the admin panel. When you’re on the admin,
   WP by default shows all sites with https links, even those without SSL. I’ve 
   fixed this in the plugin, using the admin_url filter.
 * Coincidentally, another user posted a similar issue here, I think the code I 
   posted there might work for you too. I haven’t tested it, it’s purely based on
   the admin_url filter. But if your code uses the home_url function to get those
   links, this should fix it.
 * [https://really-simple-ssl.com/forums/topic/force-external-links-to-open-in-http-before-https/#post-27314](https://really-simple-ssl.com/forums/topic/force-external-links-to-open-in-http-before-https/#post-27314)
 *  Thread Starter [peterbisset](https://wordpress.org/support/users/peterbisset/)
 * (@peterbisset)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/multisite-language-switcher-on-wp-multisite/#post-8843027)
 * Thanks for your prompt reply, would the below code need to go into the theme’s
   functions.php file or somewhere else?
 *     ```
       add_filter( 'home_url', 'rsssl_fix_https_urls' );
       function rsssl_fix_https_urls($url, $path, $orig_scheme, $blog_id){
         $ssl_enabled = false
         $options = get_blog_option($blog_id, "rlrsssl_options");
   
         if ($options && isset($options)) {
           $site_has_ssl = isset($options['site_has_ssl']) ? $options['site_has_ssl'] : FALSE;
           $ssl_enabled = isset($options['ssl_enabled']) ? $options['ssl_enabled'] : $site_has_ssl;
         }
   
         if (!$ssl_enabled) {
           $url = str_replace("https://","http://",$url);
         }
         return $url;
       }
       ```
   
 *  Plugin Contributor [Rogier Lankhorst](https://wordpress.org/support/users/rogierlankhorst/)
 * (@rogierlankhorst)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/multisite-language-switcher-on-wp-multisite/#post-8844602)
 * The theme’s functions.php should be fine.
 * Let me know if this helps!
 *  Thread Starter [peterbisset](https://wordpress.org/support/users/peterbisset/)
 * (@peterbisset)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/multisite-language-switcher-on-wp-multisite/#post-8844633)
 * I dropped it in there but got a syntax error: Parse error: syntax error, unexpected‘
   $options’ (T_VARIABLE)
 *  Plugin Contributor [Rogier Lankhorst](https://wordpress.org/support/users/rogierlankhorst/)
 * (@rogierlankhorst)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/multisite-language-switcher-on-wp-multisite/#post-8844854)
 * Sorry about that. to quick copy pasted. I’ve tested this, this works for the 
   home_url function:
 *     ```
       add_filter( 'home_url', 'rsssl_fix_https_urls' , 10,4);
       function rsssl_fix_https_urls($url, $path, $orig_scheme, $blog_id){
   
         $ssl_enabled = false;
         $options = get_blog_option($blog_id, "rlrsssl_options");
   
         if ($options && isset($options)) {
           $site_has_ssl = isset($options['site_has_ssl']) ? $options['site_has_ssl'] : FALSE;
           $ssl_enabled = isset($options['ssl_enabled']) ? $options['ssl_enabled'] : $site_has_ssl;
         }
   
         if (!$ssl_enabled) {
           $url = str_replace("https://","http://",$url);
         }
         return $url;
       }
       ```
   
 *  Thread Starter [peterbisset](https://wordpress.org/support/users/peterbisset/)
 * (@peterbisset)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/multisite-language-switcher-on-wp-multisite/#post-8844892)
 * Thanks that worked perfectly! Incidentally I’ve spoken to the author of Multisite
   Language Switcher and they are going to be working on a fix for this apparently:
   [https://github.com/lloc/Multisite-Language-Switcher/issues/103](https://github.com/lloc/Multisite-Language-Switcher/issues/103)
 *  Plugin Contributor [Rogier Lankhorst](https://wordpress.org/support/users/rogierlankhorst/)
 * (@rogierlankhorst)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/multisite-language-switcher-on-wp-multisite/#post-8845651)
 * Thanks for the update. I think it could be considered a WordPress bug, as it 
   is such a basic function in WordPress.
 * I’ll think about incorporating it in the plugin, as it’s a pretty common issue
   I think.

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

The topic ‘Multisite Language Switcher on WP Multisite’ is closed to new replies.

 * ![](https://ps.w.org/really-simple-ssl/assets/icon-256x256.png?rev=2839720)
 * [Really Simple Security - Simple and Performant Security (formerly Really Simple SSL)](https://wordpress.org/plugins/really-simple-ssl/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/really-simple-ssl/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/really-simple-ssl/)
 * [Active Topics](https://wordpress.org/support/plugin/really-simple-ssl/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/really-simple-ssl/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/really-simple-ssl/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [Rogier Lankhorst](https://wordpress.org/support/users/rogierlankhorst/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/multisite-language-switcher-on-wp-multisite/#post-8845651)
 * Status: resolved