Rewrite not working but does on the paid version of Litespeed...Why?

#1
Hello,

I have an openlitespeed install setup for development, but the company is using a paid version in production.

Everything is working but the rewrites.

The server has only openlitespeed, MariaDB, HHVM and PHP 7.2 for wp cli. No Apache is installed. It's running WordPress.

The errors I am getting are attached in error.log. The actual htaccess file is attached also.

Settings in the Virtual Host:

2019-05-02_14-52-11.jpg

Example of a set of rules in .htaccess:

Code:
<files .htaccess>
    <IfModule mod_litespeed.c>
        Order allow,deny
        Deny from all
    </IfModule>
</files>
<files readme.html>
    <IfModule mod_litespeed.c>
        Order allow,deny
        Deny from all
    </IfModule>
</files>
<files readme.txt>
    <IfModule mod_litespeed.c>
        Order allow,deny
        Deny from all
    </IfModule>
</files>
<files wp-config.php>
    <IfModule mod_litespeed.c>
        Order allow,deny
        Deny from all
    </IfModule>
</files>
<Files  ~ "\.log$">
  <IfModule mod_litespeed.c>
        Order allow,deny
        Deny from all
    </IfModule>
</Files>
The errors are below :

2019-05-02 15:44:33.249533 [INFO] Invalid rewrite directive: <files .htaccess>
2019-05-02 15:44:33.249536 [INFO] Rewrite directive: <IfModule mod_litespeed.c> bypassed.
2019-05-02 15:44:33.249539 [INFO] Invalid rewrite directive: Order allow,deny
2019-05-02 15:44:33.249541 [INFO] Invalid rewrite directive: Deny from all
2019-05-02 15:44:33.249544 [INFO] Rewrite directive: </IfModule> bypassed.
2019-05-02 15:44:33.249546 [INFO] Invalid rewrite directive: </files>
2019-05-02 15:44:33.249549 [INFO] Invalid rewrite directive: <files readme.html>
2019-05-02 15:44:33.249552 [INFO] Rewrite directive: <IfModule mod_litespeed.c> bypassed.
2019-05-02 15:44:33.249554 [INFO] Invalid rewrite directive: Order allow,deny
2019-05-02 15:44:33.249557 [INFO] Invalid rewrite directive: Deny from all
2019-05-02 15:44:33.249560 [INFO] Rewrite directive: </IfModule> bypassed.
2019-05-02 15:44:33.249562 [INFO] Invalid rewrite directive: </files>
2019-05-02 15:44:33.249565 [INFO] Invalid rewrite directive: <files readme.txt>
2019-05-02 15:44:33.249568 [INFO] Rewrite directive: <IfModule mod_litespeed.c> bypassed.
2019-05-02 15:44:33.249570 [INFO] Invalid rewrite directive: Order allow,deny
2019-05-02 15:44:33.249573 [INFO] Invalid rewrite directive: Deny from all
2019-05-02 15:44:33.249576 [INFO] Rewrite directive: </IfModule> bypassed.
2019-05-02 15:44:33.249578 [INFO] Invalid rewrite directive: </files>
2019-05-02 15:44:33.249581 [INFO] Invalid rewrite directive: <files wp-config.php>
2019-05-02 15:44:33.249584 [INFO] Rewrite directive: <IfModule mod_litespeed.c> bypassed.
2019-05-02 15:44:33.249586 [INFO] Invalid rewrite directive: Order allow,deny
2019-05-02 15:44:33.249589 [INFO] Invalid rewrite directive: Deny from all
2019-05-02 15:44:33.249592 [INFO] Rewrite directive: </IfModule> bypassed.
2019-05-02 15:44:33.249594 [INFO] Invalid rewrite directive: </files>
2019-05-02 15:44:33.249597 [INFO] Invalid rewrite directive: <Files ~ "\.log$">
2019-05-02 15:44:33.249600 [INFO] Rewrite directive: <IfModule mod_litespeed.c> bypassed.
2019-05-02 15:44:33.249602 [INFO] Invalid rewrite directive: Order allow,deny
2019-05-02 15:44:33.249605 [INFO] Invalid rewrite directive: Deny from all
2019-05-02 15:44:33.249608 [INFO] Rewrite directive: </IfModule> bypassed.
2019-05-02 15:44:33.249610 [INFO] Invalid rewrite directive: </Files>
2019-05-02 15:44:33.249613 [INFO] Rewrite directive: <IfModule mod_rewrite.c> bypassed.
2019-05-02 15:44:33.249635 [INFO] Rewrite directive: </IfModule> bypassed.
2019-05-02 15:44:33.249638 [INFO] Rewrite directive: <IfModule mod_rewrite.c> bypassed.
2019-05-02 15:44:33.249642 [INFO] RewriteBase [/] parsed, set to HttpContext 0x1500a80.
2019-05-02 15:44:33.249652 [INFO] Rewrite directive: </IfModule> bypassed.
2019-05-02 15:44:33.249655 [INFO] Invalid rewrite directive: Options -Indexes
2019-05-02 15:44:33.249658 [INFO] Rewrite directive: <IfModule LiteSpeed> bypassed.
2019-05-02 15:44:33.249661 [INFO] Invalid rewrite directive: php_value auto_prepend_file '/sites/hightide/public_html/wordfence-waf.php'
2019-05-02 15:44:33.249664 [INFO] Rewrite directive: </IfModule> bypassed.
2019-05-02 15:44:33.249667 [INFO] Rewrite directive: <IfModule lsapi_module> bypassed.
2019-05-02 15:44:33.249670 [INFO] Invalid rewrite directive: php_value auto_prepend_file '/sites/hightide/public_html/wordfence-waf.php'
2019-05-02 15:44:33.249672 [INFO] Rewrite directive: </IfModule> bypassed.
2019-05-02 15:44:33.249675 [INFO] Invalid rewrite directive: <Files ".user.ini">
2019-05-02 15:44:33.249677 [INFO] Rewrite directive: <IfModule mod_authz_core.c> bypassed.
2019-05-02 15:44:33.249683 [INFO] Invalid rewrite directive: Require all denied
2019-05-02 15:44:33.249686 [INFO] Rewrite directive: </IfModule> bypassed.
2019-05-02 15:44:33.249688 [INFO] Rewrite directive: <IfModule !mod_authz_core.c> bypassed.
2019-05-02 15:44:33.249691 [INFO] Invalid rewrite directive: Order deny,allow
2019-05-02 15:44:33.249693 [INFO] Invalid rewrite directive: Deny from all
2019-05-02 15:44:33.249696 [INFO] Rewrite directive: </IfModule> bypassed.
2019-05-02 15:44:33.249699 [INFO] Invalid rewrite directive: </Files>
2019-05-02 15:44:33.249702 [INFO] RewriteFile [/sites/hightide/public_html/.htaccess] parsed, return 0.
2019-05-02 15:44:33.249737 [INFO] [PlainConf] [virtualHostTemplate:] start parsing file /usr/local/lsws/conf/templates/ccl.conf
2019-05-02 15:44:33.255687 [INFO] [PlainConf] [virtualHostTemplate:] RCS checkin config file /usr/local/lsws/conf/templates/ccl.conf0 OK.
2019-05-02 15:44:33.255765 [INFO] [PlainConf] [context:/] rewrite [] add rules [rewritefile .htaccess]
2019-05-02 15:44:33.255801 [INFO] [PlainConf] [virtualHostTemplate:] start parsing file /usr/local/lsws/conf/templates/rails.conf
2019-05-02 15:44:33.261541 [INFO] [PlainConf] [virtualHostTemplate:] RCS checkin config file /usr/local/lsws/conf/templates/rails.conf0 OK.
2019-05-02 15:44:33.261604 [INFO] [PlainConf] [context:/] rewrite [] add rules [rewritefile .htaccess]
2019-05-02 15:44:33.261632 [NOTICE] [ZConfManager] No VHosts added, do not send!

Any help I could get would be greatly appreciated as I am lost here.

Thank you!
 

Attachments

Last edited:

Pong

Administrator
#5
It will need to be one by one case, for deny to some files or directory, you can use rewrite rules. or create context within OLS and set deny there.
 
Top