Litespeed and Wordfence don’t play nice

Having recently switched web hosting to Krystal, who support Litespeed, I’ve been playing about with the Litespeed Cache plugin for WordPress.  I’ll write about that in more detail another day, but for now, I wanted to talk about what happened when Litespeed and Wordfence (the security plugin I’m currently using) got in a room together.

Well, it wasn’t pretty.  Litespeed has a tendency to see a long running process and decide it’s evil, and abruptly and rather unceremoniously kill it.  This is good for freeing up server resources, but bad if that long running process was trying to do a full security scan of your server.

A quick Google led me to an easy solution from WordPress themselves.

Simply add this to your .htaccess file…

<IfModule rewrite_module>
  RewriteEngine On
  RewriteRule .* - [E=noabort:1]
</IfModule>

And if that doesn’t work, try this variation instead…

<IfModule Litespeed>
  RewriteEngine On
  RewriteRule .* - [E=noabort:1]
</IfModule>

The first one worked correctly for me, ensuring that my Wordfence scans completed succesfully, as they had done before the migration.

Side note, whilst we’re talking about Wordfence:  One thing that really annoys me is their website.  It has both a sticky header and a sticky footer, and they’re not particularly small either.  On my laptop, they take up about half the vertical screen estate, leaving rather little space to actually read their content!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.