• I try to use Live Writer on a multisite wordpress blog which is mapped to a primary domain. Live Writer cannot add the blog.

    I’ve found where is the issue in the code but I don’t understand why.

    Here’re my blog details for the purpose of the explanation:

    Network is “at.cameuh.net”
    Site is “easytrading.at.cameuh.net”
    Primary Mapping for the blog is “easytrading.eu”

    When setting up my easytrading.eu blog in Windows Live Writer, this XMLRPC request returns an empty array response:

    * LW request:

    Host: <strong>easytrading.eu</strong>
    <methodCall> <methodName><strong>blogger.getUsersBlogs</strong></methodName><params>
    <param><value><string>0123456789ABCDEF</string></value></param>
    <param><value><string>cameuh</string></value></param>
    <param><value><string>shutitup</string></value></param>
    </params></methodCall>

    * WP executes this PHP code to SELF-QUERY using XMLRPC to convert blogger API to wp API:

    wp-includes/class-wp-xmlrpc-server.php

    function _multisite_getUsersBlogs($args) {
        global $current_blog;
        <strong>$domain = $current_blog->domain;</strong>
        $path = $current_blog->path . 'xmlrpc.php';
        $protocol = is_ssl() ? 'https' : 'http';
    
        $rpc = new <strong>IXR_Client("$protocol://{$domain}{$path}");</strong>
        $rpc->query('<strong>wp.getUsersBlogs</strong>', $args[1], $args[2]);
        $blogs = $rpc->getResponse();
    
        if ( isset($blogs['faultCode']) )
            return new IXR_Error($blogs['faultCode'], $blogs['faultString']);
    
        if ( $_SERVER['HTTP_HOST'] == $domain && $_SERVER['REQUEST_URI'] == $path ) {
            return $blogs;
        } else {
            foreach ( (array) $blogs as $blog ) {
                if ( strpos($blog['url'], $_SERVER['HTTP_HOST']) )
                    return array($blog);
            }
            <strong>return array();</strong>
        }
    }

    * Here’s this request received by Apache:

    Host: easytrading.at.cameuh.net
    <?xml version=”1.0″?>
    <methodCall><methodName>wp.getUsersBlogs</methodName>
    <params><param><value><string>cameuh</string></value></param>
    <param><value><string>shutitup</string></value></param>
    </params></methodCall>

    * This call returns results using easytrading.at.cameuh.net!

    * The problem here lies where WP Self Query uses $current_blog->domain to setup the URL.

    * Could you fix the plugin so the proper HOST (easytrading.eu but not easytrading.at.cameuh.net) is used when WP tries to self query?

    * I’ve workarounded this issue by statically setting $domain=’easytrading.eu’ — that works while only this blog is remotely used.

    http://ww.wp.xz.cn/plugins/wordpress-mu-domain-mapping/

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

    (@wpmuguru)

    What are your domain mapping settings?

    Thread Starter cameuh

    (@cameuh)

    Global settings:

    Enabled:
    x Remote Login
    x Permanent redirect (better for your blogger’s pagerank)
    x User domain mapping page
    x Redirect administration pages to site’s original domain (remote login disabled if this redirect is disabled)

    Disabled:
    [] Disable primary domain check. Sites will not redirect to one domain name. May cause duplicate content issues.

    Blog settings:

    Primary	Domain
      x	http://easytrading.eu
    	http://easytrading.at.cameuh.net
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Domain Mapping breaks some xmlrpc functions’ is closed to new replies.