WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
[resolved] W3TC htaccess doesn't seem to work with a multi site setup (14 posts)

  1. philipwalton
    Member
    Posted 3 years ago #

    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!

  2. Frederick Townes
    Member
    Plugin Author

    Posted 3 years ago #

    If you're running 0.9.1.2 this issue is resolved.

  3. philipwalton
    Member
    Posted 3 years ago #

    No, unfortunately, it is not. Or perhaps this is a separate issue. I am running 0.9.1.2, 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.

  4. Frederick Townes
    Member
    Plugin Author

    Posted 3 years ago #

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

  5. philipwalton
    Member
    Posted 3 years ago #

    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?

  6. Frederick Townes
    Member
    Plugin Author

    Posted 3 years ago #

    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.

  7. philipwalton
    Member
    Posted 3 years ago #

    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?

  8. robnalexpress
    Member
    Posted 3 years ago #

    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.

  9. Frederick Townes
    Member
    Plugin Author

    Posted 3 years ago #

    Thanks @robnalexpress!

  10. philipwalton
    Member
    Posted 3 years ago #

    @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.

  11. robnalexpress
    Member
    Posted 3 years ago #

    @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!

  12. FGrover
    Member
    Posted 3 years ago #

    I am having a similar problem.

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

    WordPress 1: /srv/www/mywebsite.ca/public_html/
    Wordpress 2: /srv/www/mywebsite.ca/public_html/blog/
    Wordpress 3: /srv/www/myothersite.com/public_html/

    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 mywebsite.ca 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!

  13. FGrover
    Member
    Posted 3 years ago #

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

  14. philipwalton
    Member
    Posted 3 years ago #

    UPDATE:

    OK, after the 0.9.1.3 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: http://wordpress.org/support/topic/plugin-w3-total-cache-howto-wordpress-ms-w-donnchas-domain-mapping-plugin?replies=3#post-1714188

    @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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic