mod rewrite not working in LiteSpeed

#1
The rewrite in the .htaccess file worked on the old Apache server, but is not working in the LiteSpeed server 4.0.20. I heard it was fully compatible with Apache. Below is the code...

Code:
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_FILENAME} !-l
 RewriteRule ^category/(.*) /$1?tab=category [P,L]
This code causes a 500 Internal Server Error. The error in the log goes like this...
[ERROR] [REWRITE] Absolute URL with leading 'http://' is required for proxy, URL: /aromatherapy.html

Thoughts as to why this would work in Apache and not in LiteSpeed?

Thanks.
 

webizen

Well-Known Member
#3
you need to create webserver external application and refer below for proxy rewrite usage.

https://store.litespeedtech.com/store/knowledgebase.php?action=displayarticle&id=21

Proxy-Host
Modify proxy request "Host" header value, example:
web site domain name is "www.example.com", it proxy request to backend, backend is defined as a web server with name "node1", it requires domain name to be "node1.example.com", the rewrite rule should be
RewriteRule ^(.*)$ http://node1/$1 [P,E=Proxy-Host:node1.example.com]
 
Top