Support » Plugin: W3 Total Cache » [Plugin: W3 Total Cache] W3TC htaccess doesn't seem to work with a multi site setup

  • Resolved philipwalton


    Maybe I’m missing something simple, but I’m running a multi site installation of WordPress where I have 16 sites all set up as subdirectories.

    I’ve tried to activate the W3TC plugin on several of the sites, but it keeps trying to rewrite the htaccess rules differently for each site. The problem is that it’s changing the RewriteBase to /site-name/ instead of just / which it should be for my setup, so, if I activate W3TC on one of my sites, it breaks all of the sites because it has changed the RewriteBase.

    I’ve tried to manually edit the htaccess file, but then each site is telling me that the htaccess rules aren’t properly defined, and I can’t use disk caching with enhanced mode.

    So here are my question. Am I missing something? Is enhanced mode still working despite the error message, and should I just ignore it?

    Any help would be much appreciated!

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Frederick Townes


    If you’re running this issue is resolved.

    No, unfortunately, it is not. Or perhaps this is a separate issue. I am running, and I’m getting all the exact same errors.

    When I look at the W3TC settings on any of my sub-sites (not than the main one), and I try to use disk (enhanced) mode for page caching, the htaccess rules it tells me to use require setting the RewriteBase to the name of that particular sub-site.

    I have also submitted this through the support button on the plug-in itself but have heard no response. If you go in through that, you can see my exact site setup.

    Plugin Author Frederick Townes


    The directives for disk enhanced in network mode have to be manually added.

    To what? The directives the plugin tells me to add are different for every site, but obviously there is only one htaccess file.

    What directives can I add that will work for ALL of my sites?

    Plugin Author Frederick Townes


    There aren’t any, the directives are determined by the mode you are using and must appear in the document root for a given site.

    A new implementation for multi-site is coming in the next release.

    the directives … must appear in the document root for a given site.

    What? Don’t you realize that the document root is the same for all sites?

    I’ve thought some more about it, and the only possible way this could work with multi-site enabled is if the setup is using sub domains and not sub directories.

    With sub domains the RewriteBase would always be / for any site.

    However, with sub directories, your plugin tells the RewriteBase to be /site-name/ which breaks all the sites.

    Also, if I’ve set up my site to work with different domain using the domain mapping plugin, W3TC doesn’t work at all for those sites. Not even in regular disk mode.

    Are these issues going to be fixed in the next release?

    For what it’s worth, I’m using W3TC on multisite with domain mapping with no problems, but I am using sub-domains, not sub-directories. No problems with the WordPress MU Domain Mapping plugin.

    W3TC must be activated and configured separately for each site- not network activated.

    Also, none of the sites will will be fully utilizing W3TC until it is activated on ALL the sites.

    Plugin Author Frederick Townes


    Thanks @robnalexpress!

    @robnalexpress, that’s good to hear that it works with the domain mapping plugin. What do you mean when you say “fully utilizing W3TC”?

    Frederick, can you confirm that it does work for some people with sub-directories? Also, can you explain or point me towards an explanation of the advantages of disk (enhanced) vs disk?

    Thank you.

    @philipwalton What I mean is that I didn’t see any performance improvement on either site until W3TC was activated on both sites. I first activated it on my primary site and saw no performance change, but when I activated it on the 2nd site, but sites really popped!

    I am having a similar problem.

    I have several instances of WordPress installed in sub-directories on the same server:

    WordPress 1: /srv/www/
    Wordpress 2: /srv/www/
    Wordpress 3: /srv/www/

    I can only run W3TC on only one of the sites at the same time.

    If I try to enable W3TC on a second site, W3TC seems to write to the wrong .htaccess file and breaks the operation of the plugin on the first site.

    I used to be able to run W3TC on WordPress1 and WordPress 3 (same server but different domains) without any trouble, but when I added WordPress 2 (ie when I installed a second copy of WordPress in a subdirectory of so that I had 2 wordpress installations on that domain and a total of 3 websites hosted on this server), I found that I could no longer run separate instances of W3TC on any more than one of the sites at a time without breaking the others. Activating W3TC on WordPress3 breaks WordPress1. I had to disable W3TC on all but WordPress1.

    Is there a workaround to this?

    Many thanks!

    ps — to be clear, this is not a “multi site setup” using the new WP3.0 feature but rather a setup involving multiple separate installations of wordpress on the same server.

    Should W3TC be able to work on separate installations of wordpress in subdirectories on the same server? W3TC was working for me when it was installed on different domains hosted on the same server but no longer works now that I have installed another instance of wordpress in a subdirectory of the first site.

    Thanks again for any suggestions on how to get W3TC to work with this setup (multiple installations of wordpress, some of which reside in subdirectories of other wordpress installations).


    OK, after the upgrade came out, the problem with the RewriteBase has been fixed, and I can now use this plugin with sub-directories, not just sub-domains. Many thanks to Frederick!

    Also, I fixed the issue with the domain mapping plug-in from the advice I found here:

    @frederick, at this point, the only way I can get disk enchanced to work for all my sites is if I use the exact same configuration for all of them. If the configurations are even slightly different, there are conflicts with the .htaccess rules, and it breaks every site except the one I’m currently working on. (And by breaks, I mean it just disables enhanced mode.)

    This is fine for my purposes, but I imagine many people out there want to have different configurations for different sites.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘[Plugin: W3 Total Cache] W3TC htaccess doesn't seem to work with a multi site setup’ is closed to new replies.