Not working in sub-directory




Wordpress LScache Plugin: Not working in sub-directory

Last Updated on: Wed, 15 Apr 2026 00:00:02
I use Litespeed on a few sites but only just noticed that it does not work when WordPress is installed in a subdirectory but the site is viewed at root i.e. mysite.som/files is where I have WordPress installed but mysite.com is the site URL. At the moment my host has done the following: Copy the # BEGIN LSCACHE ? # END LSCACHE part of public_html/files/.htaccess , and paste that into public_html/.htaccess . I inserted it before the # BEGIN WordPress section, but after the # Force HTTPS section. Which resolves the issue but if I deactivate and reactivate Litespeed then Ill have to manually insert this each time. Hi. Just wondering if theres any news on this and whether youll be able to get it working for subdirectory installs? Thanks. Hi Greencode, Pleas check from WordPress official Post here: Giving_WordPress_Its_Own_Directory Step 7. Copy (NOT MOVE!) the index.php and .htaccess files from the WordPress directory into the root directory of your site (Blog address). Step 11. If you have set up Permalinks, go to the Permalinks Screen and update your Permalink structure. WordPress will automatically update your .htaccess file if it has the appropriate file permissions. If WordPress cant write to your .htaccess file, it will display the new rewrite rules to you, which you should manually copy into your .htaccess file (in the same directory as the main index.php file.) Are you using Method 2? Here are my suggestion methods for this case: 1. Setup a symbolic link or 2. To avoid using .htaccess under /public_html/site/ but parent folder Best, Eric Thanks for this. I tested this today and it works perfectly. I had been moving the index.php file into the site root and have been doing this for years as this was originally the suggested method by WordPress so Im not sure when they changed this advice. Anyway, all good and Litespeed is working as expected. Hi. Id like to revisit this as its not working. It does work when you follow Step 7 as you outlined above but whenever WordPress gets updated or plugins get updated then the code you add to the .htaccess to direct WP to your subdirectory install gets overwritten with the regular WP code and then causes a Error 404 on the entire site! Sorry, just to add to this. The only way of using WP in a subdirectory install without WP changing the htaccess file randomly is by using Option 2 (Method II (With URL change)). You mentioned 1. Setup a symbolic link or 2. To avoid using .htaccess under /public_html/site/ but parent folder Not sure what you mean by either of these. I have tried removing the .htaccess in the subdirectory but that has absolutely no effect and Litespeed still fails to work.



LiteCache Rush: Speed comes from using less, not from doing it faster



Reference