WordPress.org

Forums

WordPress MU Domain Mapping
Suggestion: better compatibility with FORCE_SSL_ADMIN (5 posts)

  1. Chris M.
    Member
    Posted 3 years ago #

    I've had some issues with domain mapping and FORCE_SSL_ADMIN. Here's the situation:

    ("Remote Login" and "Redirect administration pages to site's original domain" are enabled.)

    I have a site mapped to mysite.com, and its original url is mysite.mynetwork.com. So far so good. I've set FORCE_SSL_ADMIN to true. The problem is that when I'm on mysite.com and I click an administration link (from within the admin bar, or my theme), the url is https://mysite.com/wp-admin/... which isn't configured on my server (that's why I am redirecting admin pages).

    So here's my solution:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Basically, rather than redirecting to the original url on admin_init it ensures that all admin links generated by WordPress already use the correct URL. I haven't tested it extensively yet, but it seems like it's doing the job for me.

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

  2. Chris M.
    Member
    Posted 3 years ago #

    Hmm... here's a gist of the plugin I'm using to test my code, since the forums don't handle large blocks of code very well.

    https://gist.github.com/1215001

  3. Chris M.
    Member
    Posted 3 years ago #

    Oops! It seems that in it's current form, my code messes with all site URLs, not just the current one. Let me see if I can fix that real quick.

  4. Chris M.
    Member
    Posted 3 years ago #

    I've updated the gist to fix that bug: https://gist.github.com/1215001

  5. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 3 years ago #

    Thanks :) I already have something for this that someone else did a couple months back but I haven't had time to implement it. If you wouldn't mind, could you drop that link through my contact form http://ronandandrea.com/contact/ ?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WordPress MU Domain Mapping
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic