1

I'm using CyberPanelthat it work with litespeed, I want to use .htaccess but it seems not reading any command in htaccess. for example I set:

Deny from all

But it not affacted. here is vHost conf:

rewrite  {
  enable                  1
  autoLoadHtaccess        1
}
Pedram
  • 111
  • 4

1 Answers1

1

Because OLS only supports

RewriteBase

RewriteCond

RewriteRule

any other directive will be ignored and dropped.

if you want to do access control , you can use RewriteRule to do so

e.g.

RewriteRule .* - [F]  

deny access to all

RewriteCond %{REMOTE_ADDR} !^123\.123\.123\.123
RewriteRule .* - [F,L]

allow access for certain IP

You can further customize it to make a deny/allow equivalent

more detail here

qtwrk
  • 176
  • 1
  • Although the OP references "LiteSpeed", not "OpenLiteSpeed"? LiteSpeed does support the access control directive `Deny from all`. – MrWhite Jul 01 '20 at 15:09
  • 1
    Yes, LiteSpeed Enterprise does fully support directive like Deny , but he posted a conf `rewrite { enable 1 autoLoadHtaccess 1 }` , this is only to OLS. – qtwrk Jul 01 '20 at 16:34