This is an old revision of the document!


There are some LiteSpeed WebSever special directive in rewrite rules.

If you are using LiteSpeed over Apache environment, please make sure the following directive(s) included by

<IfModule litespeed>
LiteSpeed directives here
</IfModule>

So it won't be processed by Apache in case switched to it.

Don't log:

Once set, skips access logging, the value does not matter, for example:

RewriteRule \.gif - [E=dontlog:1] 

No Keepalive:

Closes the client's connection after finishing this request, the value does not matter, for example:

RewriteRule .* - [E=nokeepalive:1] 

No Gzip:

Do not use gzip compression for this request, must be set to a non-zero value, for example:

RewriteRule \.css - [E=no-gzip:1] 

do not set to 0, it has no effect.

Proxy Host:

Modify proxy request “Host” header value, for example:

A web site's domain name is “www.example.com”, it sends a proxy request to the backend, the backend is defined as a web server with name “node1”, it requires the domain name to be “www.example.com”, the rewrite rule should be

RewriteRule ^(.*)$ http://node1/$1 [P,E=Proxy-Host:www.example.com] 

Cache Control:

Modify LSWS page cache policy

enable cache

Rewriterule ^/special_cachable_url$ - [E=Cache-ctrl:max-ages=30] 
Rewriterule ^/non-cacheable-url$ - [E=Cache-control:no-cache] 

No Abort:

This flag prevents external app processes from being killed by LSWS as a runaway process while it is in the middle of processing, this is useful when running long-time PHP application.

RewriteRule ^script_url$ - [E=noabort:1]

Block Bot:

This is drop connection and useful when set up against DDoS attack.

RewriteRule .* - [E=blockbot:1]
  • Admin
  • Last modified: 2018/05/21 22:33
  • by qtwrk