Keeping the custom rewrite rules on .htaccess after LigthSpeed save

[ad_1]

In our .htaccess file we have custom rewrite rule to avoid php running on static files requests:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(robots.txt|sitemap.xml(.gz)?)
RewriteCond %{REQUEST_FILENAME} .(css|js|html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml|asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|swf|tar|tif|tiff|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip)$ [NC]RewriteRule .* – [L]

The rule is within <ifModule LightSpeed> section – because otherwise it does not execute.

But of course as such it gets deleted on LigthSpeed saving.

Is there a way to add such rules to LigthSpeed plugin to keep the behavior but avoid having the theme run it?

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer