Migrating WPMU To Subdirectory

November 11th, 2009 Posted by General 2 comments

6 Steps to Move WPMU with Domain Mapping from Root Folder to Subdirector!

I really do appreciate the WordPress Community.  Recently I had a lot of difficulties with the technical aspects of working with WordPress MU.  I wanted to move all of the files from the root folder into a subdirectory.  In the process I had a lot of help.  I’m usually the silent reader – seldom do I post a comment. I’m like a sponge: soaking up all the information. Today, I like to contribute by sharing my tip bits here because I couldn’t find the information on the Internet that will perfectly solve my problem.

This is simple:

1) Create your subdirectory (example: /public_html/subdirectory/)

2) Move all of your WordPress MU files into the subdirectory.

3) Create a file in the root (/public_html/) and name it .htaccess

4) Go to the bottom and copy the code below and paste it into your .htaccess file (located in root (/public_html/).  Be careful to paste the code in the empty .htaccess file because there are many .htaccess files.

5) If you are using domain mapping you will usually have the domain parked, so go to your cpanel and delete the domains you parked (pointing to the root /public_html/).

6) Now, this is the secret that took me 4 days to figure out with the help of my hosting company.  They did a fantastic job.  Go to your cpanel and instead of parking the domains, create it as an add-on domain pointing to the subdirectory you had created above. If you are unable to do for any reason contact your hosting company and they can manually place an add-on for the domain.

Code Below:

# Turn on rewrites.

RewriteEngine on

# Only apply to URLs on this domain

RewriteCond %{HTTP_HOST} ^(www.)?yourdomain.com$

# Only apply to URLs that aren’t already under folder.

RewriteCond %{REQUEST_URI} !^/your subdirectory path/

# Don’t apply to URLs that go to existing files or folders.

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

# Rewrite all those to insert /folder.

RewriteRule ^(.*)$ /your subdirectory path/$1

# Also redirect the root folder.

RewriteCond %{HTTP_HOST} ^(www.)?yourdomain.com$

RewriteRule ^(/)?$ /your subdirectory path/index.php[L]

Copyright 2009 by Farting Camel



Keith Graham says:

This is such a simple solution. I searched the WP site and only found notes that it should not be attempted.

I am currently installing MU at http://www.astoundingtales.com and I wanted to install in a subdir, but use the root and also keep the files that I had there already.

You solution seems to work well (this is at 1and1.com hosting). I can create a blog with a unique subdomain and everything is reachable.

I did have a 500 error the first time I tried to access after I put the htaccess file in place, but not since. I don’t know what I might have done wrong, or maybe something was typed wrong.



admin says:

Keith, you are welcome! I’m glad it worked for you. If you want to thank, thank the awesome WordPress community.

Leave a Reply

Your email address will not be published.This is a required field!

You may use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


Shia_LaBeouf_Carey_Mulligan_holding_hands Shia_LaBeouf_Carey_Mulligan_Memorial_1 Shia_LaBeouf_Carey_Mulligan_Memorial_2 Shia_LaBeouf

Topics on Farting Camel