Wordpress LScache Plugin: Multisite settings update clears .htaccess
Last Updated on: Wed, 15 Apr 2026 00:00:02 Hi! Love the plugin generally, but have just run into a couple of major problems. We manage a pretty large multisite install. After updating to the latest version (I think this was 2.x to 3.x) and tweaking some settings, every page on the site showed a 404. A quick inspection showed that the .htaccess was empty, save for the LS Cache rules. All our custom rules, as well as the WP core rules were gone. The only way we could get rid of this was to disable LS Cache completely. It did not matter whether we had it network installed or just for a single site. Seemingly, it doesnt seem to matter which settings were on/off. The same thing happened on every settings save. On deactivation, the .htaccess was also completly cleaned to a blank file. ? On another multisite note, when enabling on multisite, Id like to selectively enable cache on certain sub-sites. However, toggling the enable cache setting from Off to On does not save. Any option I set toggles back to Off automatically. Thanks, Erik Hi, I can not reproduce the .htaccess but I did reproduce the individual site cache on off thing. will report to dev to further check. Best regards, We have it running successfully on several multisite installs without this. The most major difference is that this one contains a lot more custom .htaccess rules than just the default WP rules. If that would matter. I can constantly reproduce on this site if I reactivate the plugin, deactivate, or in between, modify any setting. Hi, Could you please try on a clean WP site ? maybe something else gets in way. I can not reproduce this on default WP Best regards, Maybe its caused by the conflict in those custom rules when LSCWP tried to parse the rules. Can you paste the rules so @CacheCrawler can try w/ them to reproduce? The whole point is that this seems to only happen in this very case. We havent seen it before on any multisite config that we run. Its a bunch of proxy rules mixed with standard redirects. But ideally you shouldnt parse them at all? You should allow us to do what we want with our .htaccess and just adjust as you need. Or give an option to disable updating the .htaccess and do it manually. In this case deactivating the LS Cache plugin results in a completely empty .htaccess. What are you doing to it? Hi, By design , it only remove the rules with the marker # BEGIN LSCACHE ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ## RewriteEngine on CacheLookup on RewriteRule . - [E=Cache-Control:no-autoflush] ... ... ... ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ## # END NON_LSCACHE Thats why we think it could be a bug somehow , but we still need a way to reproduce it first. Best regards, Hi, Ive been through the source code for the .htaccess class and the only .htaccess file we have available now for this project. My conclusion is that the # END LSCACHE line must have been lost. This could easily have been a user error, Im sure. That wouldve meant that you recognised everything as being part of the LS Cache rules and cleaned it. Another conclusion of it is that this is one part user error, another part could be better prevented by dev. Since there are a bunch of (important!) comments that you add, they could perhaps be better flagged as important in the actual code. In this case the next-to-final row (## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##) suggests that it is crucial. But the one after does not, while it is in fact the latter that IS important. Id also suggest attempting some sort of safeguard against this. You could perhaps try and detect non-LS Cache related rules (say redirect rules), and at the very least, the core WordPress rules. Whether it is feasible or not to try and fix this automatically, Im not sure. But at the very least throw some kind of warning. The current detection/wrapping is perhaps a bit too idealistic?
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference