Wordpress LScache Plugin: If I write a RewriteRule ? does it have to be inside brackets?
Last Updated on: Wed, 15 Apr 2026 00:00:02 Based on this question: https://wordpress.org/support/topic/correct-code-for-vary-cookie-in-htaccess/ If I write a rule inside the .htaccess file like RewriteEngine On RewriteRule . - [E=Cache-Vary:woocommerce_current_currency] RewriteRule . - [E=Cache-Vary:wp-wpml_current_language] Does it need a bracket like ` RewriteRule . ? [E=Cache-Vary:woocommerce_current_currency] RewriteRule . ? [E=Cache-Vary:wp-wpml_current_language] or can the rule stand alone without brackets? we usually add it as ... ... to make it compatible with Apache , otherwise Apache reads E=Cache-Vary which is not its supported syntax and then will give 500 error but no , its not mandatory , but suggested for apache compatibility So it would be on top of the .htaccess, right? RewriteEngine On RewriteRule . - [E=Cache-Vary:woocommerce_current_currency] RewriteRule . - [E=Cache-Vary:wp-wpml_current_language] and afterwards comes the standard LiteSpeed rules # BEGIN LSCACHE ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ## RewriteEngine on CacheLookup on RewriteRule . - [E=Cache-Control:no-autoflush] RewriteRule .litespeed_conf .dat - [F,L] ... So it would be RewriteEngine On RewriteRule . - [E=Cache-Vary:woocommerce_current_currency] RewriteRule . - [E=Cache-Vary:wp-wpml_current_language] # BEGIN LSCACHE ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ## RewriteEngine on CacheLookup on RewriteRule . - [E=Cache-Control:no-autoflush] RewriteRule .litespeed_conf .dat - [F,L] ... Expand Correct? yes Thanks for your help @CacheCrawler ! I really appreciate it One short question ? just to be sure: There will be not conflicts of having two ... brackets and/or LiteSpeed wont delete the custom lines, right? yes , you can have multiple IfModule plugin will only manipulate within its marker , so you need to put your custom code outside of it Thanks @CacheCrawler ! I Would appreciate if you would add this to the KB or the standard .htaccess Something like: # ADD YOUR CUSTOM RULES HERE (LIKE CACHE-VARY) ## HAVE A LOOK AT THE DOCS: https://docs.litespeedtech.com/lscache/devguide/advanced/ RewriteEngine On # YOUR RULE HERE # BEGIN LSCACHE ## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ## RewriteEngine on CacheLookup on RewriteRule . - [E=Cache-Control:no-autoflush] RewriteRule .litespeed_conf .dat - [F,L] ... Expand Hi, well yeah , we have a to-do to add cookie vary inside of plugin , so user just need to put the cookie name in plugin setting without going to edit htaccess
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference