WordPress.org

Ready to get started?Download WordPress

Forums

WordPress MU Domain Mapping
Incompatibility with define( 'WP_PLUGIN_URL') (3 posts)

  1. Vince
    Member
    Posted 1 year ago #

    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?

    Thanks!

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

  2. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 1 year ago #

    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' );
  3. phsab
    Member
    Posted 1 year ago #

    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 http://www.mysite.com/ws/plugins/wp-seo/css/somekindoffile.css.
    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.