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):
Wordpress mu domain mapping subdir install-0.2 (5.27 kB)

Or just download the plugin already patched for convenience:
Wordpress mu domain mapping plugin patched for subdir install -0.5.4.1 (22.61 kB)

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.

7 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 :)

Leave a Reply