WordPress.org

Ready to get started?Download WordPress

Forums

WordPress MU Domain Mapping
Issue in domain_mapping_post_content function (3 posts)

  1. ctrl-alt-esc
    Member
    Posted 2 years ago #

    The Setup:
    WordPress 3.2.1 installed in subdirectory mode at http://blogs.example.com
    Domain mapping plugin 0.5.4.1

    http://blogs.example.com/lhs_guidance - domain mapping not enabled on this site

    http://blogs.example.com/lhs - this site has domain mapping enabled and uses http://lhs.example.com as the primary domain. This site contains a link to http://blogs.example.com/lhs_guidance in the content of a page.

    The Problem:
    When viewing that page, the url is incorrectly converted to http://lhs.example.com_guidance/

    The fix:
    In domain_mapping_post_content change:
    return str_replace( $orig_url, $url, $post_content );
    to
    return preg_replace( '/' . preg_quote( $orig_url, '/') . '\b/', $url, $post_content );

    This seems to be working ok on my site. Not sure if it will cause issues for other setups.

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

  2. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    Did you edit the site in network admin and change the URL?

  3. ctrl-alt-esc
    Member
    Posted 2 years ago #

    No, I haven't edited any urls for either of the two sites.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic