.htaccess and WHM Apache Include Editor has No Effect


I recently upgraded from Apache to Litespeed, and I have multiple directives in the "Apache Includes Editor" in the WHM interface under the "Pre Main Include" for "All Versions."

Examples of these directives include:
Apache config:
# Force HTTPS.
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Prevent wp-config.php from being accessed.
<Files "wp-config.php">
    Require all denied
<Directory ~ "(\/home\/.*\/public_html\/.*(wp-content\/uploads))">
    AllowOverride None
    <Files ~ "\.ph(?:p[345]?|t|tml)$">
        Require all denied
These directives no longer work when using Litespeed. How do I get them to work? I also attempted adding them to a .htaccess file within the public_html folder of a user (I removed the "Directory" wrapper), and they still didn't have any effect.


Last edited:


I did a test on one server
WHM Home »Service Configuration »Apache Configuration »Include Editor -> "Pre Main Include" for "All Versions."
added only
<Files "wp-config.php">
    Require all denied
and tested with
#curl -I test.domain.com/wp-config.php
HTTP/1.1 403 Forbidden
Connection: Keep-Alive
Content-Type: text/html
Date: Tue, 20 Aug 2019 09:09:41 GMT
Server: LiteSpeed
just works as expected.
also put above rule in .htaccess, all works.