How to Force Multi Site to Use Subdirectories

One of the most common issues to afflict most web developers who try to enable WordPress Multi Site is WordPress’s insistence that subdirectory blogs cannot be setup. The message WordPress throws up to show its dominance over afflicted web developers is:

Because your install is not new, the sites in your WordPress network must use sub-domains. The main site in a sub-directory install will need to use a modified permalink structure, potentially breaking existing links.

And the first thing afflicted web developers do is… they scream at their computers “What the f**k is that supposed to mean?”

Seriously, what is it supposed to mean?

The next thing they do is Google for answers. I know this because I tried both strategies before I bit the bullet and re-installed a very large WordPress installation. Some of my search terms were:

  • Can’t enable multi site subdomains
  • WordPress won’t allow subdomains
  • How do I enable subdomains not subdirectories in WordPress
  • How do I force subdomain use in WordPress MS
  • WordPress subdomain subdirectory installation problem multi site

If you followed the same path as me and eventually, after re-installing WordPress, returned to the Multi Site activation screen you would know that re-installation, contrary to what is indicated by WordPress’s message, is not the solution. No, what WordPress is trying to say in a convoluted way is not that the WordPress installation is too old for Multi Site to be enabled for subdirectories but something else. Here is a translation of its message:

The URLs of some of your blog posts might conflict with the URLs of the subdirectory sites you create when Multi Ste is enabled therefore it is advised that you do not enable subdirectory sites.

Why the hell the WordPress development team use such cryptic error messages that require translation is, well, a Universal mystery.

In short, if a WordPress site is more than 30 days old, WordPress will try to prevent its multi-site conversion from using subdirectory addon sites.

There is a workaround to enforced subdomain addon site installations. Yes, we can fight back and force WordPress to allow subdirectory sites.

Force WordPress to Allow Subdirectory Blogs

During the activation of Multi Site a few lines of code need to be added to wp-confg.php. One of those lines states:

That line tells WordPress to use subdomain addon sites.

Change it to

and you will now be able to create subdirectory sites.

Currently, WordPress messes around with subdirectory site URLs. It adds a /blog/ slug after the TLD. For example, if a subdirectory site is created with the name “apple” such that its URL should be

then WordPress renames it

Now that does not look very professional. In fact, it looks pretty damn ugly. Thankfully, the “blog” slug can be removed. A plugin is available from ThinkingWordPress (direct link) which does just that – it removes the ugly “blog” slug.

There are Two Snags with All This

Forcing WordPress to allow subdirectory addon sites on old WordPress installations has a price:

  1. Subdirectory sites that resemble existent post, page, tag, category or directory names must not be created,
  2. Some subdirectory sites will not display as they should because of conflicts with the main site’s permalink URL structure.

The solution for the first issue is simple:

  • Do not create addon sites with names the same as existent WordPress slugs.

The second problem is characterized by any of

  • Subdirectory sites do not display when viewed
  • Subdirectory sites display but their themes are corrupt (missing CSS files)
  • Subdirectory site backend admin panels redirect to the main site’s admin panel

Other symptoms will probably exist also.

The solution is simple and involves changing the Multi Site’s URL rewrite rules.

Edit your .htaccess file and replace


And that is all there is to forcing WordPress to allow subdirectory addon site installations when Multi Site is enabled.

The Blog Slug

WordPress will insist on inserting a blog slug into the sub-directory URLs such that my-blog.tld/site-one/my-post will look like my-blog.tld/blog/site-one/my-post. This can be removed with the Remove Blog Slug plugin from here.


  1. says

    Hi, thanks so much for this, its been so helpful and I am so close to solving my multisite problems. I have followed everything you wrote and managed to get my second site to work as a subdirectory (/dj/), I can add pages in the admin, but when I come to view them it throws a 404.

    Basically I am trying to view “” and my error is saying “You tried going to and it doesn’t exist.”

    For some reason it is duplicating /dj/ do you have any ideas how I may solve this?

  2. says

    It’s all good, I fixed it. I had a remove category base plugin that needed to be disabled and reactivated to kick in. Thanks so much, you are a legend!!

    One last thing, I don’t suppose you know a plugin that allows me to move posts/pages from one site to another within my network?

    • says

      Hello David, glad to hear you resolved your problem. I don’t know of a specific plugin that’ll allow you to directly transfer a post or page from one site to another within your network but I do know you can export posts and pages from one site to another via a WordPress export file. Visit Tools>Export in your Dashboard to learn more about it. I recently read on the WordPress support forum that the ability to move posts and pages directly between sites without downloading and uploading export files is a commonly requested feature; maybe the WordPress developers will put it into the next version.

  3. says

    Nice article Dion. I am planning to create new channels of my blog and right now, utilizing the multi-site feature of WP 3.0 seems to be the best way out, except for one snag – Google XML Sitemaps plugin doesn’t work in that mode. And it is quite an important plugin as far as I know.

    I did search for alternatives, finally found one called XMl sitemap feed, something like that…but that didn’t work as expected. It gave errors and all.

    So, that is what is stopping me from enabling the multi-site feature. Can you help?



    • says

      LOL, I see what you mean. Try viewing it in a different browser – sitemaps aren’t supposed to be viewable by web browsers so sometimes they load in them and sometimes they do not. the important point is whether they are readable by bots. As far as I’m aware mine is (was the last time I checked). I’ll recheck in a minute and post back.

    • says

      Hello Abhijeet, XML Sitemap Feed does work. It had a few issues initially when Multi Site was first released but there have been a few updates since. Retry it and remember that it produces a virtual sitemap so move the old sitemap from your blog’s root directory (rename it) and use the KB robots.txt plugin to direct search engines to your new sitemaps (add something similar to “Sitemap:” to your virtual robots.txt file (no quotes)).

      I suggest the kb robots.txt plugin because each virtual site requires its own robots.txt file and the best way to create one is to use the plugin to serve them when called by bots.

      Also, the sitemap address can sometimes be a variation of your sites usual address prefix e.g. OR OR http://site.tld/sitemap.xml . One of them will work, it’s just a case of using trial and error to establish your sitemaps’ address.

      Good luck with your sites and post back if you need any help.

    • says

      Here’s a thread I posted on WP support forum – ..check what the plugin author has to say about caching and all. I gave your site as the example there. :)

      I use Robots Meta plugin already. Should I still go for KB robots.txt? And are you sure that each new site would need it’s own robots.txt? I was told by someone, who owns a huge blog with different channels, that he only has one robots.txt but different sitemaps. Although, he uses sub-directories and has separate WP installations in them. So I thought it should be more or less the same in WP sub-directory multi-site structure too…one robots.txt and different sitemaps…doesn’t work that way?

    • says

      I’ve just looked at and replied to that thread. Google accepts the sitemap. I’ve just re-submitted it to double check it.

      Regarding robots.txt, robots.txt is read by bots if encounted in subdomain and root directories but is ignored if encountered in subdirectories. If you use subdomain sites and want to specify different rules per site (e.g. for sitemap locations) then you will need a plugin to control the output of each site’s robots.txt file which is dynamically created by WordPress when requested by bots. Two other ways to direct search engines to your sitemaps are, 1, add a link to it in the footer of your websites and, 2, submit each site’s sitemap location to individual search engines (e.g Google’s Webmaster Tools, Bing’s Webmaster Tools).

      The reason I use KB Robots.txt is that I know it works with Multi Sites. If you know that your current robots plugin works with Multi Site then stick with it.

    • says

      So that means, since I’d be using sub-domains, I don’t need to worry about robots.txt, right? ( and yes, Robots meta does work in multi-site mode..I guess I just need to network activate it).

      I cannot see your reply on that thread for some reason. Hence I’ll ask you here. Do you use W3 total cache? Did you configure it separately for each of the new blogs you added?

      Another question – did you a notice significant changes in your search traffic after you shifted to the xml sitemap feed plugin? I just wanna be absolutely sure before I shift to that sitemap plugin. Google’s so important you know. ;)

    • says

      If you install your sites in subdomains you will need a robots.txt file for each site; if you install your sites in subdirectories you will (as far as I know) not need a robots.txt for each site. I usually create them for all my sites, just in case.

      I do use W3 Total Cache. I did configure it separately for each site. The plugin’s Multi Site version is awkward to set-up because it doesn’t automatically create the directories it requires to store cached files; also, it doesn’t automatically edit the .htaccess file. It is also the caching plugin recommended by Hostgator (my preferred host).

      I didn’t notice any drop in traffic after installing XML Sitemap Feed. You might be surprised but JournalXtra only gets between 400 and 500 unique visitors per day. Sometimes only 300. Most of my traffic comes from Google (98%, at a guess). Most of the rest comes from backlinks, Bing then obscure search engines followed by Yahoo and Ask. Never really ranked well with Yahoo, bing and Ask. I really don’t know why. Compete and Alexa tell a different story but their figures are made up, ahem (cough, cough), I mean extrapolated from stats collected from the browser’s of surfers who have particular plugins installed that track their surfing habits.

      Sitemaps aren’t really necessary unless your site is poorly set-up. Provided you link into your site and every page is linked into from other pages within your site then you shouldn’t really require a sitemap. the only reason I use sitemaps is that everybody else uses them and so there might be a reason for them that I’m not aware fully of, lol.

      As you might have guessed, I’ve not pushed JournalXtra, I submitted it to search engines, a few social media sites and I reference it in forums and blogs. It’s time I took my own advice and started writing articles for article directories but there are only 24 hours in the day and I seep during some of them ;-)

    • says

      Just to let you know, WordPress MS creates a separate virtual robots.txt file for each site it serves. Remember that when you use a plugin that creates a virtual robots.txt or sitemap.xml for each of your sites you must not have a non-virtual sitemap.xml or robots.txt file stored in your root site’s (or other sites’) root directory.

  4. says

    Ah, Dion, I am confused again. :) Could you please check out that WP thread again – , especially the conversations I had with RavanH towards the end.

    I basically need to know what are the steps I should follow. Here’s my current position – I have a WP blog, WP version 3.0, it has a manually created robots.txt and a sitemap.xml created by the google xml sitemap plugin.

    Now, I need to enable multi-site mode and add 1 or 2 blogs in sub-directories. Since google xml sitemap plugin doesn’t work in that mode, I need to ensure that I find something else.

    So here’s what I am gonna do.

    1. I’ll activate WP multi-site.

    2. I’ll make sure it accepts sub-directories by following the tutorial given by you in this article.

    3. I’ll remove google xml sitemaps plugin, and also remove any sitemap.xml file in the root directory.

    4. I’ll install and activate the xml sitemap feed plugin.

    5. I’ll go to the robots.txt file in the root directory, which I had from the very beginning, and add references to sitemaps for the new sites at the end (as suggested by RavanH)

    So, those are the steps I’ll follow. Now you gotta tell me if everything’s alright in the above steps. Do check that WP support forum thread too. :)

    • says

      Hello again, I wondered when you’d post back. I understand your confusion. The steps you have outlined are the ones I would follow. RavanH knows more about sitemaps than I do and his suggestion seems to concur with those provided at

      Because you are using sub-directories instead of sub-domains, RavanH suggests you reference each of your sitemaps in your robots.txt file by adding a line similar to


      to the end of your non-virtual robots.txt file for every sitemap you have.

      As a further example, if you have three sites then you should add three references to sitemaps to the end of your non-virtual (real/physical) robots.txt file:


      Hope that helps.

      A little warning here: if your sites attract lots of visitors, are server resource hungry and you use a shared server then WordPress MS might not be the right option for you because one site’s over usage might result in all sites being put out of action by your host suspending your single WordPress MS index.php script. At least with non MS sites, all sites have an individual root index.php script and if one is suspended then it affects only the site it belongs to.

  5. says

    OK, cool. So we now have both the experts (you and RavanH) on the same page, and I know exactly the steps I need to follow. Good. :)

    Yeah, I am on a shared server, but the traffic isn’t that much. The site is only 6 months old. Plus I am planning to move to VPS next month anyway. So I think it’d shouldn’t be a problem. But thanks for informing me.

    Thanks again Dion for your prompt replies. Really appreciate it. I’ll report back when I have the process done, which I think should be this weekend.

  6. says

    Works excellent , thanks you really very much , I can’t imagine how many days I should spent to resolve this problem without you. Gotta say that I have changed the subdomain installation to subdirectory (so NO new fresh installation ) and this thing seems that works too.

  7. Dave Harris says

    This page:


    “You cannot choose Sub-directory Install in the following cases:

    * If your existing WordPress installation has been set up for more than a month, due to issues with existing permalinks. (This problem will be fixed in a future version.) ”

    Does the above this this issue? Or can I still not transition my current set of individual WP blogs (using subdirectories) to WP 3.x multisite, using subdirectories? I would love to move to WP MS if this issue has been fixed by the above code (it’s not clear to me).

    Thanks, this is a great tutorial in any case!

    • says

      The above guide addresses that issue so, yes, you will be able to force WordPress to use subdirectories with the above guide. Be careful before migrating to WordPress MS. If your sites are CPU/memory hungry and you’re on a shared server then WordPress MS might not be the right solution for you.

  8. says


    I was just working with a site that has this implemented and had broken somewhere along the way. Failing to find and fix the problem, we’ve implemented the whole network and forced subdirectories anew, and it almost all works except that the dashboards of all the sub-sites have no CSS or images (actually the sites themselves have no style from the Twenty Ten theme either). All the image and stylesheet URLs have the site slug in them rather than being located at the root of the network.
    So they’re NETWORK_URL/site-slug/wp-admin/css… instead of NETWORK_URL/wp-admin/css…

    Have you encountered this? Have you any idea how to fix it? You mentioned something that sounded similar to this in the post, but I’m pretty sure I used significantly unique URLs. I don’t believe that is the cause.

    • says

      Hello Kristarella, welcome to JournalXtra.

      I had the same issue until I implemented the second list of re-write rules stated in the post. The only suggestion I have is that you check your re-write rules. Possibly use a near blank .htaccess file with only the DirectoryIndex index.php line and the essential WordPress re-write rules stated above. Another possibility is that a plugin is interfering with the sites’ display. If neither the aforementioned work, try mirroring some of the network in a fresh WordPress installation in subdirectory (new database with a couple of sites exported to it) to see whether the issue persists.

      Please let me know your solution if you resolve the issue some other way.

      Re-reading the post I realised I had forgotten to mention the method for removing the ugly blog slug. I’ve edited it accordingly.

  9. Hunter Gatherer says


    Worked great on an “old” new site that we hadn’t posted content on yet. I’ll let you know when we try to migrate an existing one.

    Thanks a lot for your guidance. The only thing I could add is that when you go to Tools>Network, that’s when it’s going to ask you to “Install”, with only the subdirectory option. After you hit “install”, that’s when you update your wp-config.php file and your .htaccess files to your given code.

    I wasn’t sure whether to hit “install” when it only gave the subdirectory option. I went ahead and did, then was given the opportunity to do your suggested modifications.

    Good work. Many, many thanks.


    • says

      I reckon you’re using the Redirection plugin. Go to Redirection>Groups>Modified Posts then delete all redirections that show as a forward slash (/) only. If not the redirection plugin then it’ll be something similar. Please post back with your results whether good or bad.

    • says

      I’m just about to goto sleep. I’ll quickly reply before I do. It is a strange problem you’re having.

      I would reactivate the Redirection plugin and make the changes I showed earlier. Even try your site with as near empty an .htaccess file as possible. If you use DirectoryIndex index.php then leave that as the sole line in it. Remember to back up your.htaccess file before editing it.

      If none of the above help it will be a process of elimination. I would start disabling and re-enabling plugins individually. If you’re not worried about disabling all plugins simultaneously then re-enabling them individually post testing for the error then I would do that.

  10. says

    The only other code in the .htaccess was for W3 Total Cache but I have deleted that temporarily for testing purposes here. I haven’t gone through and reactivated each plugin one by one but the redirection happens when all are deactivated as well as when all are activated.

    I will try reactivating them one by one.

    • says

      Temporarily change your permalinks to the WordPress default and see what happens. Backup your original settings so you can easily restore them after testing.

      Also, use the contact form (see menu bar above) to send me a copy of the edits made to your wp-config file. Please do not send the whole document, I don’t need your database details :)

    • says

      Hello Dustin, I’ll reply here as well as at for the benefit of others.

      You said the /blog/ slug still shows in the backend. It will. That’s normal. It does this with my test blogs and with those I install for others.

      I’m now stumped as to what to suggest. It’s good we’ve established it’s a permalink issue. But knowing how to fix it is something else. I’ve had a few problems with WP MS that have required me to re-install to get it functioning as it should (unrelated to forcing sub-directories). Those problems were created by plugins. Maybe that’s what you’ll have to do. We’ve tried disabling and re-enabling plugins, we’ve checked the redirects created by the Redirection plugin (removed root / redirects) and you’ve used an .htaccess file with only the essential rules.

      Maybe the .htaccess WordPress re-write rules are wrong. Here’s a copy of the .htaccess rules used on one of my subdirectory using WP MS sites:

      DirectoryIndex index.php

      RewriteEngine On
      RewriteBase /
      RewriteRule ^index\.php$ - [L]

      # uploaded files
      RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

      # add a trailing slash to /wp-admin
      RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

      RewriteCond %{REQUEST_FILENAME} -f [OR]
      RewriteCond %{REQUEST_FILENAME} -d
      RewriteRule ^ - [L]
      RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
      RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
      RewriteRule . index.php [L]

      Try the above .htaccess file and see what happens. It’s possible there’s a mistake in the rules you are using.

    • Ken says

      hey thank!  had similar isssues,and while the first htaccess post didnt work, THIS one did.

      ty ty ty ty. I cant thank you enough.

    • says

      I’m in agreement with you that I tried all the things you mentioned above.

      No luck on that new .htaccess. Same results. I’m moving towards backing up/exporting my current WP installation (around 1,000 posts), doing a fresh install and then importing all the posts/pages after I set up multisite.

    • says

      Just a question Dustin, do any of your post titles conflict with you subdomain names?

      Backing up and re-installing can be a tedious job. It’s not always perfect either. Have you done it before?

      Given your current problem, I wouldn’t use the original database. I’d keep it so I could export components of it e.g. the tables for certain plugins.

    • says

      Does your hosting plan allow addon domains? If so, I can point one of the domain names I use for test sites toward your server so you can create a mirror of MLTnews to test that re-installation will fix it. If you want to do this, join me on Facebook and I’ll set it up. It’s easier that way than by posting multiple comments here. Attention other readers: I’ll write up the solution for others once one is found. My Facebook profile ID is

    • says

      Thanks for that information Andrea. I would have replied sooner but I’ve been away and neglecting my duties. I need to update the guide a little, I’ll do it during this week. Have fun :)

  11. says

    Hi Dion,

    Well, I tried the process on an existing site. The content is not critical, so if I have to reinstall things, it’s not a big problem.

    This is what happened:
    1) I did all the instructions: edited the config; edited the htaccess; uploaded everything:
    2) Went to Tools>Network
    3) The only offer was subdomains
    4) Installed
    5) Got the screen with the codes and salts: installed them in the appropriate files; edited config for subdomain false; change the .htaccess; completed the process;
    6) logged out
    7) logged in
    8) SuperAdmin present
    9) Add site> added a couple of sites; assigned a theme

    This is where the problem happened:
    10) I went to the Dashboard> My Sites
    Both main and a sub-site show up in the admin list
    11) Then…. clicked Dashboard on the subsite and I get a palin vanilla page with the following:
    Site Name (the actual name is in there)
    Just another site
    Skip to content

    * Home
    * About

    Not Found

    Apologies, but the page you requested could not be found. Perhaps searching will help.
    Search for:
    Branson Getaways
    Proudly powered by WordPress.
    12) There is no way to get to the dashboard or admin for the subsite. Except via: SuperAdmin>sites>mysitename; If I click on the site name, the options page comes up; but the left hand admin is all for the main site, not the sub site; if I click any of the mysite menu items, I get the “Not Found” error above.

    I tried doing it a couple of times with different sub sites. I disabled all the plug-ins first, then did it.

    I’m stumped. Any ideas?



  12. says

    I am having a similar issue to HG. Took exising WP Blog and Added Network feature with subdirectories.

    Added 2nd site: but domain mapped it to

    Only some people can actually see the blog (which is just generic) and I can’t get the dashboard for that site at all.

    The original dashboard has all the Super Admin stuff, but I can’t get to the dashboard for the new blog. Can’t change theme or anything.

    Wondering if there is a permissions issue or some other PHP mod I missed somewhere.

    Thanks in advance for thoughts.


    • says

      Hello Brendon, I’ll say the same as I have to HG. I need to do a bit of research. In the meantime, check your server error log for the site; there might be a clue to the cause in it. It would help if I could access your site to look over a few backend settings.

  13. Hunter Gatherer says

    Hi Dion,,

    Thanks for following up. Since my site had only a minimal amount of content, I decided to just do a complete re-install with a new database. I ran into a few problems along the way, but ended up over at the WordPress forum on Multisite. Among other things, I couldn’t log in; got no SuperAdmin, etc. and had to do the cycle a few times. The easiest part was getting away from the white screen of death. Andrea Rennick helped me. She did mention this problem a number of times on other threads. Just start a thread. I only got over there AFTER I messed up the reinstall. So, I never solved the page theme problem just by itself. Although, a new installation and new database finally did the job, once I cleared the cache so my password would work again.

    Thanks and good luck.


  14. says

    I have three blogs running on my domain. I think multisite allows control of the sites from a superuser to manage the multi sites.
    I’m actually looking for a way to have the page rank of all the pages/posts on the three blogs count toward the page rank of the main site.
    Do you or any of your readers have any ideas if this can be achieved please?

    • says

      You would need to link from all pages to your main site’s home page. You’re home button and logo will link to the home page of each site. Add a link to your main site in the footer area of all sites (displays on every page). Most search engines read a limited number of links per page before they stop following them (I think it’s something like 30 links) so be if your pages might contain a lot of links, link to your main site from the header or menubar of all networked sites.

      Generally speaking, page rank is not very important. Getting traffic to your site is. Backlinks from related sites work best.

  15. Mehul Kothari says


    I just installed WP 3.1 in Arvixe account and my plan is to have multisite installation. So, I followed the steps given on for multisite installation.
    I did the steps:-
    1. adding one line in wp-config.php.
    2. Logged In and select sub-directories as option and then added 2 new folders in wp-admin and added more lines in wp-config.php.
    3. But at that time, I do not have .htaccess file so I tried in web.config and it did not work and so I reverted back.
    4. I logged into the site and I could see network admin and all. Now I created one additional site and I click on Dashboard link and it give 404 error.
    5. Then I found out from hosting provider(arvixe) that I can add the rules in the rewrite module in the remote IIS 7 and then I added all of them from the IIS through .htaccess file but I got that one red message that RewriteBase / directive is not supported and then I removed the space between RewriteBase and slash (/) and it worked. Now, I create new site and click dashboard but it did not work and it gives the same error. Can you please help here.


    • says

      Hi Mehul,

      I’m assuming you’re using a Windows server. Correct me if I’m wrong.

      Did you use the replacement re-write rules that I’ve stated in the post above?

      Have you been with Arvixe for long? If not then I would consider moving over to Hostgator on a Linux server where WordPress is supported out of the box. Hostgator have a one click install that sets up 3.1. Plus, you can host unlimited domains under one hosting account. Check out their baby plan which currently has a 20% discount.

  16. Mehul Kothari says


    Yes, I have put the replacement rules like:
    # BEGIN WordPress

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index.php$ – [L]

    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ – [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*.php)$ $2 [L]
    RewriteRule . index.php [L]

    # END WordPress

    Also, I have been using Arvixe for ASP .net application and now we thought to have same hosting provider for wordpress, so we installed wordpress.
    In the above rule, when I put in remote IIS server, the rewritebase is not supported but when you remove the space between slash, the error goes away.
    Can you please help to get the subdirectories issue resolve ?

    • says

      Hi Lukeradi, it’s most likely an htaccess rule that’s the issue. If it works with a blank htaccess file then you will need to look at the current file for errors.

      Before I can give any other suggestion I need to know whether you can you see the front end of the site and whether it’s only the admin section that’s inaccessible. Do you get any error messages?

    • says

      Matt, you are welcome. Please share this and please look around at my WordPress .htaccess hardening posts because I’m sure you will find them useful.

  17. says

    I hacked the code to enable subdirectory installation.  1 line and that’s it.  Installation was flawless.

    add the following line in
    “wp-admin/network.php” at line: 66

    return true;

  18. HunterGatherer says

    Hi Dion,

    I’m at it again on a another site.  I forgot the whole process and found your page again.  I’ll follow your instructions and give it a go.  I’m glad you’re still here.



    • Hunter Gatherer says

      Thanks a bunch for your help.  I can’t believe how relatively easy this was thanks to you.  I took an old site that had just been sitting there, moved it to a network install and got buddypress up and running in minutes.  Without you it wouldn’t have happened until Andrea straightened it out.  That code eliminated the 404’s in an instant.

      You’re on the top of the heap.  Thanks again…

  19. Hunter Gatherer says

    Hi Dion,

    Most of it went okay.  No major installation issues.  But I do have a problem viewing the pages.  All of them, other than the site’s home are showing as 404 errors.  I put a BuddyPress over it, went through the normal BP configuration; it created pages and navigation; but nothing shows up.  I took BP off and it does the same thing and I can’t get to any real pages.  The error reads

    Error 404 – Not found

    Your browser can’t find the document corresponding to the URL you typed in.

    Got any ideas where I went wrong and what to do next?

    Many thanks again,


    • says

      Recreate the wildcard DNS record for subdomains. BuddyPress sometimes upsets the server. I don’t know why it does it but it’s happened to me a few times: as soon as I activate BuddyPress on any site hosted on the server this site is on, my server forgets the wildcard DNS so WP can’t create subdomain sites. At which pint I’m forced to delete the wildcard and recreate it.

      If recreating the wilcard DNS record fails to solve it, do you have a redirection plugin installed and are we working with an .htaccess file that contains only the WordPress rewrite rules (and maybe “DirectoryIndex index.php”)?

    • Hunter Gatherer says

      Thanks for the quick reply.  I must not have been clear; 

      I set it up as a subfolder install; not subdomain.  I’m sure that has something to do with it. 

    • Hunter Gatherer says

      They look like this:

      RewriteEngine On
      RewriteBase /
      RewriteRule ^index.php$ – [L]

      # uploaded files
      RewriteRule ^files/(.+)

      wp-includes/ms-files.php?file=$1 [L]

      RewriteCond %{REQUEST_FILENAME} -f [OR]
      RewriteCond %{REQUEST_FILENAME} -d
      RewriteRule ^ – [L]
      RewriteRule . index.php [L]

    • says

      Try these:

      # BEGIN WordPress
      RewriteEngine On
      RewriteBase /
      RewriteRule ^index.php$ – [L]

      # uploaded files
      RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

      # add a trailing slash to /wp-admin
      RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

      RewriteCond %{REQUEST_FILENAME} -f [OR]
      RewriteCond %{REQUEST_FILENAME} -d
      RewriteRule ^ – [L]
      RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
      RewriteRule  ^[_0-9a-zA-Z-]+/(.*.php)$ $1 [L]
      RewriteRule . index.php [L]
      # END WordPress

      Do you have any plugins installed that might interfere with the way WordPress writes permalinks and have you been to Settings>Permalinks to save them again?

    • says

      I know, I know but don’t tell everyone :D

      Here’s something you’ll like to know: when using multi-site, install and network activate the Proper Network Activation plugin. Some plugins fail to properly activate across a network when network activated, this plugin forces them to activate properly.

      Have fun with your new site. Let me know if you need more help  :)

  20. says

    though not directly related, this is similar, and not finding any resolve. 

    WordPress MU
    Using Wildcard DNS
    wildcard DNS and new account creation work good
    RSS on tld works using feedburner –>

    RSS does not find a feed on 
    it merely reloads the page. 

    Posts on Permlinks issue
    when using custom permalinks Posts permalinks are not working, they bounce to 404, though when you call the posts permalink, the structure all looks correct parsing /%year%/monthnum%/%day%/%post-name%/
    when changed to default permalink posts permalinks work.

    so kind of a compound issue here, one may or may not be related to the other. 

    again, this is a WordPress MU, added was implemented after MU was enabled. blog was semi-existing, but in another unrelated issue, we actually dumped the database, and reimported posts from blogger (blogs)

    ok that is that, hope there is something you can do other than ha ha ha reinstall

    • says

      Hello John, take a look through your .htaccess files in the WordPress installation directory and directories above it. I’ve a feeling you have a rewrite rule that’s preventing the RSS feed from displaying. Do you have a rewrite rule to remove the www hostname? WordPress automatically resolves that and placing such a rewrite in your .htaccess will cause problems in a multisite installation. Also, check for redirects in plugins like “Redirection”.

      Plan of action:

      1) Disable all plugins used anywhere within the Network
      2) Check whether pages and the RSS feed still 404.
      3) If they do 404, check all .htaccess files within and above the WordPress site’s installation directory. Look for rewrites that might cause problems. Also, delete the WordPress specific rewrite rules and save your permalinks again.

      My gut feeling is that it’s a rewrite issue or some other .htaccess directive that’s causing the problem.

      Let me know what happens.

  21. says

    Dion, Thanks! As others have said, you have made the inexplicable very easy. Haven’t touch Multisite for about 18 months, now building a new collection of sites and your post saved me HOURS!

    One question for you. . . my main WPsite is at, and I want all my subsites at Does this mean I need a single-site version of WP on, and then a MS version at sub, Or can I work some htaccess magic to make this more sane?

    Thanks again for all you help!

  22. Chips says

    I had no idea what I doing, and this was an enormous help. One suggestion – move Hunter Gatherer’s comment (from 2 years ago), regarding when to include the ‘false’ statement. I was very reluctant to hit ‘install’ before reading that comment. Many thanks.

  23. Tom says

    I enabled the 3.0+ network only with one line, define(‘WP_ALLOW_MULTISITE’, true);
    I can’t choose subfolders, and I like to have that (it’s a must)
    If I add the line from the post I got a “site doesn’t exists on the network” message. Anybody has the same? Maybe it’s from an outdated activation? Help please if you can!

    • says

      Hi Tom, the activation process is the same. The important step is to change define(‘SUBDOMAIN_INSTALL’, false); to define(‘SUBDOMAIN_INSTALL’, true); then go back into Network Set Up in the WordPress dashboard and follow the instructions given there.

      You might find the site doesn’t exist error is because you have a site named after an already existing tag or category.

  24. Gary Gonzales says

    Hi Lee, Fantastic information, which allowed me to implement sub directories despite WordPress telling me I couldn’t. A bit scary at first for me uploading this as I don’t use FTP that much and to be honest , not really au fait with directories and files. But I got there in the end, so Many Thanks. One problem I have come across is that when viewing Themes, the option to delete the theme has disappeared! Any ideas??

    Best Regards,

    Gary G

    • says

      You’ll find the option to delete themes in the network admin panel at

      Thanks for posting Garry and I’m glad this post helped you.

  25. Caspar says

    Hi Lee, thanks for this clear post. Very helpful indeed! I currently have a WP Multiside with 5 subdomains that I’d like to change to sub-directories because of better Google searchability. How now do I move the contents from the subdomains to the sub-directories? I was thinking to just change the urls both at the WP-MS admin part and the physical directories via FTP. Who that do it?

    • says

      Hi Casper, changing the physical directories via FTP won’t work because there won’t be any to change. WordPress multisite uses virtual directories.

      I’m not sure how successful the following methods would be but they are the methods I would use. The 2nd method is the one I would try first.

      Possible Method 1:

      Create an export of each site using the WordPress export tool at Tools > Export then re-import into each new subdirctory site. You would need to use a script to change media upload URLs. Such a script exists (details below).

      Possible Method 2:

      Use the Database Search and Replace Script to change all URLs of the subdomain sites to the new URLs of the new subdomain sites and also use it to change each subdomain site’s database prefix to its new subdirectory site’s database prefix. Migrate them one at a time by creating a subdirectory site before migrating the subdomain site to it; then move on to the next migration.

      Neither method will be uncomplicated.

      However you do it, you must make a database backup so you can restore the site if anything goes wrong. You might need to export your database as multiple small packets to ensure the export is complete.

      If I were to do it for you I’d charge between $75 and $150 per hour, depending on the number of hours it takes – the more time it takes the less I charge per hour (based on my retainer rates).

    • Caspar says

      Thanks Lee. I’ll first try myself. Three questions though:

      If I change subdomain install to false, will the subdomains and the site actually still be active as such? In other words can I run this operation in parallel with the existing sites still functioning?
      Can I keep using the multisite install?
      What are 301 redirects?

      thanks again

    • says

      Hey Casper!

      Let’s assume you have a subdomain multisite install. When you change subdomain install to false, the subdomain sites will no longer be visible or accessible. Your site will be ready for subdirectory sites to be created.

      Conversely, let’s assume you have a subdirectory multisite install. When you change subdomain install to true, the subdirectory sites will no longer be visible or accessible. Your site will be ready for subdomain sites to be created.

      to recap the difference between subdomain and subdirectory:

      A subdomain looks like

      A subdirectory looks like

      You can switch back and forth between subdomain and subdirectory multisite setups but while using subdomains, no subdirectory sites will be available; and whie using subdirectories, no subdirectory sites will be accessible.

      The moment you use a script to edit the URLs of one of your subdomain sites within the WordPress database is the point when you will not be able to switch back again to using that particular subdomain site.

      For example, if you have a subdomain site of and you switch to using sub directories so use the script to edit the database data for URLs that start “” to change them to “″; after making the change, will no longer exist in your database so will no longer be accessible. If you have a, it will remain accessible while ever subdomain installs are true and so long as you have not used the script to change its URL from to

      Hope you’ve followed along so far :)

      A 301 redirect is URL redirection that sends visitors from a no longer existing URL to a new URL, for example, a 301 redirect from to

      Please ask as many questions as you need to ask.

      Also, please backup your database before you make any changes to it. Using the script will change your database.

    • Caspar says

      Hello Lee,

      It’s me again. I managed to move from subdomains to directories. Yet since there are no virtual subdomains anymore I tried 301 redirecting the old virtual subdomains to the new directories. When I enter the old URL it redirects to the primary domain only and not to the new subdirectory. Any idea how I can fix this? If you want I can send you my .htaccess.

  26. says

    I used wordpress 3.5.1 and tried the step you gave as I want subfolders, not subdomain on my 1 year old site.

    But after editing the config & htaccess as instructed, and log again as WPMU told me to do, I get the error that the site cannot connect to the database.

    Do you know what I did wrong ?

  27. Brock says

    Adding the ‘subdomain_install’ line and setting it to false causes the site to show: “No site defined on this host. If you are the owner of this site, please check Debugging a WordPress Network for help.”

    Removing .htaccess doesn’t help.

    Any ideas?

  28. says


    I have this issue and try to follow your instructions. But i dont find the: define( ‘SUBDOMAIN_INSTALL’, true );

    and when i paste it, also tried with: define( ‘SUBDOMAIN_INSTALL’, false ); in the file wp-config I get an error message, after i uploaded it, thats related to the server.
    its like the whole admin system shuts down.

    What do I do wrong? Where shall i Put it?

    Thanks a lot

    • says

      This is the messade: No site defined on this host. If you are the owner of this site, please check Debugging a WordPress Network for help.
      Saw you answer above and its not www before, do you know what i can do? Thanks a lot!

    • says

      Hi Leia, I think I know where the fault is. Have you added the wildcard subdomain and if so, does your host support subdomain installations on your hosting package?

      Also, you might have a DNS setting that needs to be changed for your domain name. Sometimes we need to recreate the wildcard subdomain. Other times we need to remove then re-add the root domain to the hosting package (but don’t delete any files).

      Let me know how you get on.

    • says

      Sorry, Leia, I misread your question. I need to see the wp-config.php file.

      Can you contact me at leehodson -a.t.- Send me a link to your website and I’ll take a look.

    • says

      Hi Leia,
      Sorry for jumping but since I resolved the issue on my site I am very eager to help you.
      If you don’t have the SUBDOMAIN_INSTALL mentioned in your wp-config, are you sure the site is the multisite. Please verify that you are referring to the correct wp-config. I wrote about my success story and would be glad if you find it helpful. Please read below and let me know.


  29. says

    I have a multisite at this point with subdomains.
    I am having bad time doing seo for the subsites so i am planning to change it back to either subdirectory multisite or categorized url with single site install. But wondering if either of the two would cause me any trouble.
    Please help me take a decision on subdirectory multisite or plain wp install with category in the url to appear like subsites.

    • says

      Have you tried Ultimate SEO (or is it SEO Ultimate)? It by far the best of the free SEO plugins I’ve tried. It is multisite compatible. Also, install Better Google XML Sitemaps because that’s multisite compatible too.

      If you do decide to switch to single site or ms with subdirectories, you’ll need to migrate your content over.

      Each site in an MS install has its own database tables so the content created for the subdomain sites will remain intact if you switch to MS subdirectories or single site with categories. The subdomain site content won’t be visible until migrated to over. There is probably a plugin that can help there.

      With regard to SEO, switching site type will require you to redirect from old URLs to new URLs.

    • says

      Hi Lee,
      Thanks for your reply! Appreciate your instant response.
      I buy your suggestion of using the plugins you suggested for Multisite.
      For your information, last night I was very curious to change my subdomain url structure to subdirectories. The site is still Multisite and the procedure was very simple. Just a few updates and the site was ready with the new structure in about 1 hour.
      There is no need to do any migration, etc unless you are changing your main domain or the hosting server.
      I also wrote about the success story in my blog that I will share with Leia so that Leia can also follow this.

      Glad to be connected with you.

  30. says

    I’ve followed your post. I’m running 3.5.2. It was a new install that I imported posts from another website. I can access the admin menu no problem but when I visit the site I get a 404 error. I’n not sure where I am going wrong. My design isn’t uploaded yet and all my plugins are turned off. Do you think my importing my posts set my site as “old”?

  31. Sharif Khalladi says

    Hi Lee,

    Thanks for this – it worked like a charm, however, url’s without a trailing slash aren’t working in any of the sites that are created in subfolders.

    ie and its subsequent pages work with and without trailing slash (

    but on a trailing slash is required. without it the page redirects to

    any ideas? it’s probably something in the .htaccess


    • says

      It’s an unusual issue that’s probably caused by a redirection plugin that you have installed. There is a solution: add this to the top of .htaccess:

      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^(.*)([^/])$ /$1$2/ [L,R=301]

  32. danny says

    You could also just delete the default page and post that gets installed with wordpress (and remove from trash as well). Then it will let you choose sub-directory.

    • says

      Save your permalinks again.

      Also, go to the network dashboard and follow the network setup instructions with regard to the htaccess rewrites that need to be in place.

  33. jacksonpon says

    there is error 500.. after i replace the contents in the .htaccess file. After changing back to the old contents of the .htaccess, i was able to return to my website.. any idea where went wrong?

    • says

      Many different reasons for people to use subdirectories. Some people prefer subdirectories because they want to keep all content under one domain while still enjoying the benefits of using distinct WordPress admin panels to control the display of sections of their websites. For example, allowing guest writers to add content to their websites while limiting the guest writers’ admin access to only those areas of the website that relate to their subject matter; or, using different themes and plugins for different parts of their websites.

Leave a Reply