WordPress.org

Ready to get started?Download WordPress

Forums

WordPress MU Domain Mapping
mixed SSL & non-SSL domains (10 posts)

  1. Frett
    Member
    Posted 2 years ago #

    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.

    [1] https://github.com/frett/wordpress-mu-domain-mapping/compare/master...forceProtocol

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

  2. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    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.

  3. Frett
    Member
    Posted 2 years ago #

    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.

  4. Jasonheffner
    Member
    Posted 1 year ago #

    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.

  5. Frett
    Member
    Posted 1 year ago #

    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.

  6. Jasonheffner
    Member
    Posted 1 year ago #

    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"] == "mymainhost.com" ) {
    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.

  7. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 1 year ago #

    @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.

  8. Jasonheffner
    Member
    Posted 1 year ago #

    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.

  9. Jasonheffner
    Member
    Posted 1 year ago #

    @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.

  10. Jasonheffner
    Member
    Posted 1 year ago #

    @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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.