WordPress.org

Ready to get started?Download WordPress

Forums

WordPress MU Domain Mapping
With "Remote login" option enabled, getting a 403 on the included script tag (5 posts)

  1. rlgrobert
    Member
    Posted 2 years ago #

    Hello. On some of the networks I am running, when I enable the Remote login option, the sites load fine with the mapped domains, but in my browser console I'm getting a 403 error on the domain mapping script tag that gets included in <head>. (The one making a call to the primary site with the ?dm=xxx... query string.)

    Any ideas why this would be? It's weird because I'm not getting the errors on one of the networks, but I am on the others.

    Thanks.

  2. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    My first guess would be security running on the client browser. An exception may have been approved for one domain but not another.

  3. rlgrobert
    Member
    Posted 2 years ago #

    Thanks for the reply. I don't remember doing anything with the browser security for the domains on the network that is working properly. Is there a way to test if this is the issue?

    Could it be a file permissions issue somewhere? Oh, and I just noticed that the error is showing in Chrome and Safari (webkit) but not Firefox.

    Any ideas on how I could debug this?

  4. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    I don't have Safari but I did check chrome and didn't get anything in the console.

    Unfortunately, I only use Chrome for testing and I'm not all that familiar with the settings/internals of it so I can't give you much direction.

  5. NickParsons
    Member
    Posted 2 years ago #

    I realize this is a pretty old thread, but I had the same issue and wanted to post the solution I figured out in case anyone else came googling here.

    The short story - it's caused by the "." (period) in the domain name that gets loaded in the "back" parameter of the script. Example:

    http://somesite.com/?dm=abc123&action=load&blogid=6&siteid=1&t=123
    &back=http%3A%2F%2Fsomeothersite.com%2F

    My solution is pretty hack-ish, but here's what I did:

    1. Open domain-mapping.php
    2. Add this at line 255:
      $_GET['back'] = str_replace('_','.',$_GET['back']);
    3. Then replace line 799 with this:
      echo "<script src='{$protocol}{$current_site->domain}{$current_site->path}?dm={$hash}&action=load&blogid={$current_blog->blog_id}&siteid={$current_blog->site_id}&t=" . mt_rand() . "&back=" . str_replace('.','_',urlencode( $protocol . $current_blog->domain . $_SERVER[ 'REQUEST_URI' ] )) . "' type='text/javascript'></script>";

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic