Support » Plugin: W3 Total Cache » [Plugin: W3 Total Cache] Problems with Multisite, subdirectory install

  • Hi,

    After running WP Super Cache for quite a while, I decided to try out W3TC on a development server. I completely disabled and remove WP Super Cache before installing W3TC.

    W3TC is causing me problems, though.

    With only Page Caching turned on, I am seeing weird redirects. For example, when I go to the main URL ie:, I get redirected to one of the sub-blogs ( When requesting sub-blogs, I get redirected to sub-pages within other sub-blogs, etc. Something strange is afoot.

    I have W3TC “network enabled”. Is this the correct way to enable it on multisite?

    On the settings side, things look ok in my root blog, but when I check the W3TC settings in one of my sub-blogs, I get an error about the .htaccess file:

    You've selected disk caching with enhanced mode however the .htaccess file is not properly configured. Please create an empty file in /.htaccess and run...

    Do I need to configure W3TC in each sub-blog separately, with separate htaccess rules, too? (That would stink.)

    I am seeing these problems for users who are not logged in.


Viewing 12 replies - 1 through 12 (of 12 total)
  • Hard to describe what’s going on now. Things seem ok with just Page Cache enabled now.

    Now, when I turn on database caching, I see the weird redirects now.

    Also, I have some code that uses switch_to_blog and it pulls in posts from another blog on the same network installation. Permalinks and links to post thumbnails are broken.

    With W3 Total Cache disabled, this code works fine. Only when I enable W3TC do I see this specific problem.

    W3TC cannot be network enabled. You must enable it on each site. Additionally W3TC needs to add rewrites to your .htaccess file in order to function properly. Since there is only one .htaccess file and all your sites access it you will need to make sure that your settings are the same for all of your sites.

    So you setup your first site and add the proper lines to your .htaccess file. Then when you create each additional site you will get a warning saying that your .htaccess file is not configured correctly. In order for that message to disappear you need to go into the new site and make sure that the settings mirror the settings from your first site.

    Adding this right before my switch_to_blog call seems to solve the permalinks problem.

    Thanks kfawcett. This sounds like a major pain, and I’ve not found any documentation about it, aside from what you wrote. I may need to stick with WP Super Cache.

    It’s not that much of a pain. You only have to do it once per site.

    It looks like the settings should be copied from the main site, upon activation, as Frederick writes here:

    He says in the next release. I’m do not believe that function has made it into the release stream yet.

    Thanks for your help.

    I am still confused by if/when the various htaccess files need to be updated and how. Ideally, one set of htaccess rules would work.

    BUt, it looks like W3TC augments at least one htaccess file and makes it sub-blog specific.

    This one has sub-blog specific statement in it. I did not add it manually, so I assume W3TC did:


    I may be missing something obvious, but I don’t get how this scales.

    Here’s how mine WPMU works. I’m running sub-domains. Not sure if you’re the same or if you’re running sub-directories

    I have one .htaccess file. I install W3TC and select Active, not Network Active. I setup my first site. I configure W3TC how I want it. I create my next site. I get the warning the the .htaccess file is not correct. I ignore it. I go through the settings for W3TC and make sure they are the same as the first site. The .htaccess warning then goes away. The .htaccess that is in wp-content/w3tc/pgcache/.htaccess is not important. That is not the main .htaccess file for your network. The main .htaccess file should be above your wp-content folder. For me that is the public_html folder. That is where all of the rewrites that are needed go.

    Thanks again. I am running a sub-directory install. Perhaps that is the difference between my setup and yours.

    For what it’s worth, if I enable it only for the root blog, things seem fine. The page cache seems to work even for the sub-blogs, even with the plugin not enabled for them. However, I do not get the html comments at the bottom of the page confirming this.

    The reason I think it’s working: the cache files for the sub-blogs are created in wp-content/w3tc/pgcache/ and I can edit them and see the edited files being served. Weird.

    But, as I write this, I am not sure this makes any sense.

    Frederick, could you provide some info here? Looking for advice on a subdirectory multisite install. thanks.

    Plugin Author Frederick Townes


    How you have it set up is fine. I will add super admin controls soon that will make it easier to grok what W3TC is doing on your install.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘[Plugin: W3 Total Cache] Problems with Multisite, subdirectory install’ is closed to new replies.