• Hello, 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 https:// rather than https:// and therefore the links don’t work. On all of the other https:// 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 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Dennis Ploetner

    (@realloc)

    That seems to be a bug. Would you mind to open an issue here?

    I think that you could in the meanwhile hook into “msls_options_get_permalink” like in the following example:

    <?php
    /**
     * @param string $postlink
     * @param string $language
     * @return string
     */
    function my_msls_options_get_permalink( $url, $language ) {
        if ( 'de_DE' != $language ) {
            $url = str_replace( 'https://', 'https://', $url );
        }
        return $url;
    }
    add_filter( 'msls_options_get_permalink', 'my_msls_options_get_permalink', 10, 2 );
    Thread Starter peterbisset

    (@peterbisset)

    Thanks for the prompt response, I will do that now. So this code would go in MslsOptions.php? Would it override some of the code that is already there?

    • This reply was modified 7 years, 9 months ago by peterbisset.
    Plugin Author Dennis Ploetner

    (@realloc)

    No code like this should stay in your functions.php. But be careful mine is just an example…

    Thread Starter peterbisset

    (@peterbisset)

    OK that works for all of the pages except the homepage of the https site still has https links. All of the internal pages are now fine!

    • This reply was modified 7 years, 9 months ago by peterbisset.
    Plugin Author Dennis Ploetner

    (@realloc)

    There should be also an else with the first two parameters of str_replace switched.

    Thread Starter peterbisset

    (@peterbisset)

    Sorry php isn’t my strong point, where would I need to drop the else statement? And the else statement looks like this?

    else ( ‘de_DE’ != $language ) {
    $url = str_replace( ‘https://&#8217;, ‘https://&#8217;, $url );
    }

    • This reply was modified 7 years, 9 months ago by peterbisset.
    Thread Starter peterbisset

    (@peterbisset)

    If anyone else experiences this issue then here is a temporary fix from the Really Simple SSL plugin which fixes it too:

    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://","https://",$url);
      }
      return $url;
    }
    Plugin Author Dennis Ploetner

    (@realloc)

    Nice! Thanks.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Really Simple SSL’ is closed to new replies.