The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

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

  1. Chris M.
    Posted 4 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.


  2. Chris M.
    Posted 4 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.


  3. Chris M.
    Posted 4 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.
    Posted 4 years ago #

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

  5. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 4 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