Wordpress LScache Plugin: LS not updating htaccess in public_html
Last Updated on: Wed, 15 Apr 2026 00:00:02 Hi, Im new to Litespeed Cache and Im using it on a Litespeed server with CPanel. Very happy with it so far but couple issues .. 1. If WordPress is installed in its own folder, then LS updates the .htaccess in that folder, but not the one in public_html. Is this the correct behaviour? I find I have to copy the whole # BEGIN LSCACHE section into my public_html .htaccess file to get it working. 2. I noticed that if I choose to Minify/Combine/HTTP/2Push CSS/JS in the plugin settings, it doesnt change the LSCACHE section in any htaccess. Can anyone explain how the site then knows whether to use Minify/Combine/HTTP/2Push CSS/JS? Thanks, Sal. Hi, Could you please specify more about your site structure ? You mean , you have a site in /sub-directory , while use .htaccess to redirect it to become https://www.domain.com instead of https://www.domain.com/sub-directory ? Best regards, Hi, Thanks for our reply. The site is http://www.domain.com but wordpress is installed in http://www.domain.com/wordpress My index.php file in public thus says ? / Loads the WordPress Environment and Template / require( dirname( __FILE__ ) . /wordpress/wp-blog-header.php ) The htaccess file in /wordpress is being updated when I activate LS, but the htaccess file in public_html is not. I have to C&P the LS code into that one. Any feedback re Q2 above? Thanks. Hi, I am not sure , I will run some test and get back to you. Could you please confirm that you were using this method to do so ? If not , please provide the method that you did to make this structure so I can reproduce and check the issue. Best regards, Hi, Yes, I used Method II. Site has been running this way for years. Ta. S. 1. If WordPress is installed in its own folder, then LS updates the .htaccess in that folder, but not the one in public_html. Is this the correct behaviour? To get LsCache to work with WordPress in a subdirectory, all you need is this in your htaccess (placed before the # BEGIN WordPress rules). CacheLookup public / 2. I noticed that if I choose to Minify/Combine/HTTP/2Push CSS/JS in the plugin settings, it doesnt change the LSCACHE section in any htaccess. Not sure if its due to an issue with your configuration, but I see the following rules in my htaccess (in the WordPress subfolder). ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ## ### marker MINIFY start ### RewriteEngine on RewriteCond % DOCUMENT_ROOT % REQUEST_URI ^(. )/min/( w+) .(css|js)$ RewriteCond %1/wp-content/cache/$2/$1.$2 -f RewriteRule min/( w+) .(css|js) wp-content/cache/$2/$1.$2 [L] ### marker MINIFY end ### Thanks for your reply @luminsol 1. I added these lines to the .htaccess in public_html on a new site and activated LS Cache, but it didnt work. The LS code was aded to the .htaccess in /wordpress OK, but checking the home page site headers showed x-litespeed-cache: miss after refreshing several times. When I copied the LS lines to the htaccess in public_html (as I have been doing), this changed to x-litespeed-cache: hit,private straightaway after refreshed the page. 2. I understand and I have these lines in my .htaccess too, but my question was how doe the site know whether I have chosen to Minify/Combine/HTTP/2Push CSS/JS in the plugin settings? Sal. Hi, my question was how doe the site know whether I have chosen to Minify/Combine/HTTP/2Push CSS/JS in the plugin settings? The rewrite rule are used to mask /wp-content/cache/css/xxxxx.css to /min/xxxxx.css Ultimately its controlled by PHP, LSCWP will check its setting in databse to determinate whether you have enable such function or not. Best regards, @CacheCrawler OK, thanks, I Understand. Sal. Hi, I can see that .htaccess issue you mentioned , will have to talk with devs about it. Please use your temporarily solution for the time being. Best regards,
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference