Support » Plugin: WordPress MU Domain Mapping » Incompatibility with define( 'WP_PLUGIN_URL')

  • Hi,
    Here is my setup: a working WP multisite network (with subdomains) running WP 3.5.1 and last version of domain mapping plugin.
    To clean the code and hide that WP is being used, I have the following line in my wp-config.php :

    define( 'WP_PLUGIN_URL', '/plugins');

    When I network-activate the domain mapping plugin, a lot of URL are messed up (ex: http://www.exemple.comr/image.png). After looking in the code of the plugin, the error comes from line 651, in the domain_mapping_plugins_uri() function.

    Could you check against absolute plugin URL before returning the mapped URI?
    Is there a workaround to make domain mapping works alongs with custom plugin path?


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


    It isn’t that it’s a custom URL. It’s a path vs a complete url.

    Have you tried defining the DIR instead of the URL? ex

    define( 'WP_PLUGIN_DIR', '/path/to/wp/plugins' );

    I was facing a similar problem when using WP SEO by Yoast. My dev site is a replica of my production site, with the only difference that on the dev site I don’t use domain mapping. So WP SEO worked like a charm on the dev site, but when I activated on my production site it didn’t work properly. I found references to http://www.mysite.como/css/somekindoffile.css in my site instead of
    However when I deactive the domain mapping the references are correct.
    I’ve worked around this by adding the following code to my wp-config.php:

    if (isset($_SERVER['HTTPS'])) {
            define( 'WPSEO_FRONT_URL', 'https://'.$_SERVER['HTTP_HOST'].'/ws/plugins/wordpress-seo/' );
            define( 'WPSEO_URL', 'https://'.$_SERVER['HTTP_HOST'].'/ws/plugins/wordpress-seo/' );
    } else {
            define( 'WPSEO_FRONT_URL', 'http://'.$_SERVER['HTTP_HOST'].'/ws/plugins/wordpress-seo/' );
            define( 'WPSEO_URL', 'http://'.$_SERVER['HTTP_HOST'].'/ws/plugins/wordpress-seo/' );

    But now I’m about to activate an other plugin and I run into the same problems again. I could again define the constants for this plugin, but I don’t think I should keep doing this.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Incompatibility with define( 'WP_PLUGIN_URL')’ is closed to new replies.