WpMU Domain mapping in subfolder install

Here's a solution to run a wordpress multisite installation with domain mapping even if you didn't install wordpress in the DocumentRoot of your site.

If you want to map domains to subdomains in your wordpress install for example womsend.ro to ro.womsend.com you would use the wordpress-mu-domain-mapping plugin but this only works if wordpress is installed dirrectly in the web site's document root not in a subdirectory.

I like to have wordpress installed in a subdirectory because it keeps things organized especially if I have other things installed on your site.

So here is a patch to the wordpress domain mapping plugin that allows it to work with the subdirectory install. Download the original plugin then apply the patch (this patch is for the 0.5.4 version of the plugin):
[download id="26"]

Or just download the plugin already patched for convenience:
[download id="27"]

After adding a new site you have to go to Network Admin -> Sites, select the site and edit some of it's configuration values ( wordpress default values will not work ):

1) In site Info Tab, the Path is set to "/" . You have to add the subdirectory to it. For example if your site's document root is /home/site/public_html and wordpress is installed in /home/site/public_html/wordpress then the Path should be set to /wordpress
2) After saving the changes at #1, in the site Settings tab , Siteurl should already be set to http://{SubDomain}{Path} where {Path} is the path set at #1, but if it's not then set it.
3) The changes at #1 also modified ( in wp 3.1.3 anyway ) the "Home" value in the Settings tab , adding the Path to it but this has to be clean of the path so you have to change it back to http://{SubDomain}/

That's it, let me know how it works in the comments.

8 thoughts on “WpMU Domain mapping in subfolder install

    1. I’m hoping to update it for the latest version soon. Not sure if it makes sense to put it in the directory since it’s just a patch to an existing plugin.

      1. I would appreciate, I have a multisite installation with subdirectories blogs and I need to adapt it to the 0.5.4.3 version, but I’m a little lost. I looked at the code and I can not see how. Thank you very much for your time and for your work, authors should put this possibility in future versions.

  1. Hi Mihai,

    my WP installation is in a sub directory rather than the root directory of my
    hosting package.

    It is also a WP multi site installation.

    I am trying to get MU Domain Mapping working but apparently the default MU plug in if WP is installed in a sub directory.

    I read in your blog that you have a ‘patch’ but I cant seem to get to the .diff and .zip files when I click on the links.

    Would you be able to help by re-posting the links or pointing me to where it outlines the ‘patch’ that is required?

    Thanks in advance 🙂

  2. Hey, I’m using your pact & it is working great. Now on my Network Admin dashboard I get a notification that there’s an update available for WordPress MU Domain Mapping ( version 0.5.4.3). Can I do the update or will it break the patch?
    Thank you!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.