Support » Plugin: WordPress MU Domain Mapping » [Plugin: WordPress MU Domain Mapping] mixed SSL & non-SSL domains

  • I have a project that requires some mapped domains to be SSL and some to be non-SSL. Currently the domain mapping plugin generates urls using the protocol of the current request, this is causing some of our non-SSL domains to be requested as SSL and vice-versa for other domains when requests are redirected from one domain to another.

    I coded up a patch[1] that optionally allows a protocol to be defined per domain. By default the original mechanism of determining the protocol is used unless a protocol is specified.

    I would love for this patch to be merged so we don’t have to maintain our own modification of the plugin. Let me know if anything needs to change or I overlooked something when making the patch.


Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Ron Rennick


    MultiSite Guru

    I won’t be able to look at it in detail for a few weeks. The one thing I noticed is that you used an enum. The WP database schema used to contain enums. They were all subsequently removed. To be consistent with WP, I wouldn’t incorporate an enum into any plugin.

    updated it to use a varchar(20) and to filter the submitted protocol to be http or https only since MySQL will no longer filter invalid protocols.

    I’m very interested in this patch as we are running in a mixed non-SSL with SSL admin environment. I tried your patch out, however, once installed it doesn’t seem to allow new domains to be created or map current domains. Am I missing a step, perhaps database update, needed for this to work?

    I’m running on WP 3.4.2 now.

    fyi.. I’m currently running mapped domains in non-SSL only and the plugin works great.

    the database should automatically update itself when you use my modified version of the plugin and access the domain mapping settings page (/wp-admin/network/settings.php?page=dm_admin_page). This is the same place that automatically creates the database table.

    after the db is updated, the table ($wpdb->base_prefix . ‘domain_mapping’) should contain a protocol column.

    I did get your changes to work on a development system, however they didn’t really help with the problem. I ended up adding this to wp-config.php. My issue was with FORCE_SSL_ADMIN adding https:// to my mapped domain that doesn’t use SSL.

    if ( $_SERVER[“HTTP_HOST”] == “” ) {
    define(‘FORCE_SSL_ADMIN’, true);
    define(‘FORCE_SSL_LOGIN’, true);

    I suspect your changes are specifically for SSL enabled hosts you want to have domain mapped.

    I’m trying to get the Remote Login to work properly now.

    Plugin Author Ron Rennick


    MultiSite Guru

    @jasonheffner – If you are going to mix the SSL mode the remote login is not going to work.

    You could probably hire a developer to write something for you so it would work.

    Thanks @ron – I finally figured out what was happening last night with SSL, remote login, url rewriting, and redirections. I’m going to either need to write some helper code for the additional domains, or allow administration over non-ssl on those mapped sites to support login. If I had a wildcard cert it would be awesome, but can’t for this particular site.

    @ron We reconfigured the server architecture for SSL and changed FORCE_SSL_ADMIN to false. I now have Remote Login working properly with mixed SSL mode.

    @ron @frett .. I just came full circle back to this patch. After I reconfigured SSL through Pound this patch works great.

    I had to make one addition to remote_login_js() to hard code the $protocol to ‘http://’ for some domains. Most of my mapped domains are non-SSL, however the primary domain is ‘SSL’. The protocol is always selected from the primary domain in the code and @frett you might want to add in an option to pull this value from your new row value, $row->protocol.

    If you don’t then when you have remote login enabled it will redirect you to the protocol of the network domain and not the individual mapped domain.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: WordPress MU Domain Mapping] mixed SSL & non-SSL domains’ is closed to new replies.