WordPress.org

Ready to get started?Download WordPress

Forums

WordPress MU Domain Mapping
Media uploads use SSL links under domain mapping (8 posts)

  1. itdoug
    Member
    Posted 2 years ago #

    I posted an update for a different bug but I think they might be related after some further investigation.

    http://core.trac.wordpress.org/ticket/15928

    Basically, when this setting in the domain mapping plug-in is unchecked

    "Redirect administration pages to site's original domain (remote login disabled if this redirect is disabled)"

    all uploads get an HTTPS URL. If every domain map site on the network install does not have a valid certificate then images do not load. However, if that checkbox is checked this does not seem to happen in the URLs are created as http and they use the original network URL.

    Of course if it is checked there are cookie and redirect issues in the current version. Basically, you get redirected so many times to different login pages even when you are already logged in. Is it possible that these are related? Any chance this has been addressed in a development version as well?

    http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/

  2. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    Any chance this has been addressed in a development version as well?

    No. Part of the issue with this is WP core. It is only coincidental that the issue only occurs with certain domain mapping settings.

    However, you could write your own filter for upload_dir to substitute the http: for the https:.

  3. itdoug
    Member
    Posted 2 years ago #

    No idea what you mean about an upload filter. Is there a resource or plugin for something like that.

    Will these be addressed in a wordpress core update? Is there another topic I could follow?

    Thanks!

  4. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    Reference for adding a filter: http://codex.wordpress.org/Function_Reference/add_filter

    The $tag that you would filter is upload_dir

    Will these be addressed in a wordpress core update?

    Since you commented on the trac ticket you linked to above you will get an email every time there is activity on that ticket.

  5. itdoug
    Member
    Posted 2 years ago #

    Thanks! I'll check that out.

    One more thing I noticed that may or may not be related but wanted to pass along is that currently even the "view site" links from the admin bar load the site as SSL. Is this part of the same SSL bug

  6. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    I don't use SSL. We have a quasi-high speed Internet connection. Essentially, at the best of times our Internet connection is about on par with the speed of low end DSL connections. The best of times being after 11PM at night. Using anything on SSL is very slow for us.

  7. glamor
    Member
    Posted 2 years ago #

    hi. i made a filter for this as was recommended by Ron.

    i uploaded the file to my mu-plugins directory. the file consists of this code:

    <?php
    
    function fix_ssl_siteurl($url) {
      if ( 0 === strpos($url, 'http') && is_ssl() )
        $url = str_replace( 'http://', 'https://', $url );
      return $url;
    }
    add_filter('option_siteurl', 'fix_ssl_siteurl');
    add_filter('option_home', 'fix_ssl_siteurl');
    add_filter('option_url', 'fix_ssl_siteurl');
    add_filter('option_wpurl', 'fix_ssl_siteurl');
    add_filter('option_stylesheet_url', 'fix_ssl_siteurl');
    add_filter('option_template_url', 'fix_ssl_siteurl');
    
    ?>

    however, everything thats is uploaded is still linking to https://mysite.com/mappedsite if i have remote login enabled or to https://mappedsite.com if remote login is not enabled. the previous is not a problem as that has a valid SSL cert. however, the mapped site does not have a valid SSL cert. and therefore causes errors :/

  8. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    As an interim solution you can use the upload_dir filter to replace the https:// with http://.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic