MMO P&S Litespeed cache problems .htaccess requests to add or replace file

poomoooo

New member
Joined
Aug 6, 2024
Messages
6
Hello everyone!

I'm encountering an issue with the LiteSpeed Cache plugin. It consistently, well, perhaps not always, but frequently prompts me to insert or replace the code below (the code might vary at times, but in this specific instance, it's as follows) in the .htaccess file:

Code:
# BEGIN LSCACHE
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
<IfModule LiteSpeed>
RewriteEngine on
CacheLookup on
RewriteRule .* - [E=Cache-Control:no-autoflush]
RewriteRule \.litespeed_conf\.dat - [F,L]

### marker CACHE RESOURCE start ###
RewriteRule wp-content/.*/[^/]*(responsive|css|js|dynamic|loader|fonts)\.php - [E=cache-control:max-age=3600]
### marker CACHE RESOURCE end ###

### marker FAVICON start ###
RewriteRule favicon\.ico$ - [E=cache-control:max-age=86400]
### marker FAVICON end ###

### marker WEBP start ###
RewriteCond %{HTTP_ACCEPT} "image/webp"
RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+webp]
RewriteCond %{HTTP_USER_AGENT} iPhone.*Version/(\d{2}).*Safari
RewriteCond %1 >13
RewriteRule .* - [E=Cache-Control:vary=%{ENV:LSCACHE_VARY_VALUE}+webp]
### marker WEBP end ###

### marker DROPQS start ###
CacheKeyModify -qs:fbclid
CacheKeyModify -qs:gclid
CacheKeyModify -qs:utm*
CacheKeyModify -qs:_ga
### marker DROPQS end ###

</IfModule>
## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##
# END LSCACHE

Beyond understanding why LSC behaves this way, I'm more interested in finding a solution to cease the recurring warnings every time I log into my WP dashboard. Can someone guide me on automating this process so that LSC can autonomously add the necessary code? Thanks!
 
I’m using CyberPanel with LiteSpeed and haven’t run into those issues or had to do much editing. You could try CyberPanel for your next project—it's super easy to install with just one click.

As for your problem, I’m not sure, sorry!
 
I’m using CyberPanel with LiteSpeed and haven’t run into those issues or had to do much editing. You could try CyberPanel for your next project—it's super easy to install with just one click.

As for your problem, I’m not sure, sorry!

Same here, I’ve never had to edit the .htaccess file manually.

Maybe there’s a permissions issue causing the problem.
 
You could try CyberPanel

Is this a plugin you're using?

Maybe there’s a permissions issue causing the problem.

That makes sense...

Quick question: Do you use Loginizer? It’s the only plugin I can think of that often asks me to remove write permissions from the .htaccess file. These two plugins might be clashing with each other.
 
Is this a plugin you're using?

It’s an alternative to cPanel—open-source software for managing servers.

Loginizer asks you to remove write permissions from the .htaccess file for security. It’s safer when plugins can’t write to important server files, preventing malicious plugins from adding anything unwanted.

The code you posted looks like it's handling the cache expiration headers, which should help. It seems safe enough.
 
The code you posted looks like it's handling the cache expiration headers, which should help. It seems safe enough.


I don’t quite get this sentence (English isn’t my first language, and I’m not very tech-savvy, so could you please rephrase or explain what it means?).

Thanks again for the explanation about CyberPanel! :)
 
Back
Top Bottom