htaccess from Apache to Litespeed

Discussion in 'Apache Migration/Compatibility' started by Will, May 27, 2018.

Tags:
  1. Will

    Will New Member

    Hi there,
    I am trying out Litespeed, but having a hard time making mod rewrite work.
    Can anyone help me make this htaccess file works on LS, please!
    Thank you so much!
     

    Attached Files:

    Last edited: May 27, 2018
  2. Will

    Will New Member

    This what I get on the log
    Code:
    2018-05-27 17:45:40.396188 [INFO] Rewrite directive: RewriteEngine on bypassed.
    2018-05-27 17:45:40.396192 [ERROR] Invalid rewrite directive: CacheLookup on
    2018-05-27 17:45:40.396227 [INFO] Rewrite directive: </IfModule> bypassed.
    2018-05-27 17:45:40.396232 [INFO] Rewrite directive: <IfModule mod_rewrite.c> bypassed.
    2018-05-27 17:45:40.396236 [INFO] Rewrite directive: RewriteEngine on bypassed.
    2018-05-27 17:45:40.396253 [INFO] Rewrite directive: </IfModule> bypassed.
    2018-05-27 17:45:40.396258 [INFO] Rewrite directive: <IfModule mod_expires.c> bypassed.
    2018-05-27 17:45:40.396261 [ERROR] Invalid rewrite directive: ExpiresActive On
    2018-05-27 17:45:40.396265 [ERROR] Invalid rewrite directive: ExpiresDefault "access plus 1 month"
    2018-05-27 17:45:40.396269 [ERROR] Invalid rewrite directive: ExpiresByType image/x-icon "access plus 1 year"
    2018-05-27 17:45:40.396273 [ERROR] Invalid rewrite directive: ExpiresByType image/gif "access plus 1 month"
    2018-05-27 17:45:40.396276 [ERROR] Invalid rewrite directive: ExpiresByType image/png "access plus 1 month"
    2018-05-27 17:45:40.396279 [ERROR] Invalid rewrite directive: ExpiresByType image/jpg "access plus 1 month"
    2018-05-27 17:45:40.396283 [ERROR] Invalid rewrite directive: ExpiresByType image/jpeg "access plus 1 month"
    2018-05-27 17:45:40.396286 [ERROR] Invalid rewrite directive: ExpiresByType text/css "access plus 1 month"
    2018-05-27 17:45:40.396290 [ERROR] Invalid rewrite directive: ExpiresByType application/javascript "access plus 1 year"
    2018-05-27 17:45:40.396293 [INFO] Rewrite directive: </IfModule> bypassed.
    2018-05-27 17:45:40.396296 [INFO] Rewrite directive: <IfModule mod_rewrite.c> bypassed.
    2018-05-27 17:45:40.396299 [INFO] Rewrite directive: RewriteEngine On bypassed.
    2018-05-27 17:45:40.396331 [INFO] Rewrite directive: </IfModule> bypassed.
    2018-05-27 17:45:40.396335 [INFO] Rewrite directive: <IfModule mod_rewrite.c> bypassed.
    2018-05-27 17:45:40.396339 [INFO] Rewrite directive: RewriteEngine On bypassed.
    2018-05-27 17:45:40.396343 [INFO] RewriteBase [/] parsed, set to HttpContext 0x21b21f8.
    2018-05-27 17:45:40.396352 [INFO] Rewrite directive: </IfModule> bypassed.
    2018-05-27 17:45:40.396357 [INFO] RewriteFile [/home/trangalangas.com/public_html/.htaccess] parsed, return 0.
    2018-05-27 17:45:40.396510 [INFO] [PlainConf] [virtualHostConfig:] start parsing file /usr/local/lsws/conf/vhosts/36024x7.com/vhost.conf
    2018-05-27 17:45:40.404232 [INFO] [PlainConf] [virtualHostConfig:] RCS checkin config file /usr/local/lsws/conf/vhosts/36024x7.com/vhost.conf0 OK.
    2018-05-27 17:45:40.404616 [INFO] [PlainConf] [virtualHostConfig:] start parsing file /usr/local/lsws/conf/vhosts/Example/vhconf.conf
    2018-05-27 17:45:40.412466 [INFO] [PlainConf] [virtualHostConfig:] RCS checkin config file /usr/local/lsws/conf/vhosts/Example/vhconf.conf0 OK.
    2018-05-27 17:45:40.412537 [INFO] [PlainConf] [virtualHostConfig:] rewrite [] add rules [rewritecond %{HTTP_USER_AGENT}  ^NameOfBadRobot]
    2018-05-27 17:45:40.412547 [INFO] [PlainConf] [virtualHostConfig:] rewrite [] add rules [rewriterule ^/nospider/         -   [F]]
    2018-05-27 17:45:40.412727 [ERROR] [config:server:vhosts:vhost:Example:context:/protected/] Path for context location is invalid: /usr/local/lsws/Example/html/protected/
    2018-05-27 17:45:40.412798 [INFO] [PlainConf] [virtualHostTemplate:] start parsing file /usr/local/lsws/conf/templates/ccl.conf
    2018-05-27 17:45:40.420390 [INFO] [PlainConf] [virtualHostTemplate:] RCS checkin config file /usr/local/lsws/conf/templates/ccl.conf0 OK.
    2018-05-27 17:45:40.420474 [INFO] [PlainConf] [virtualHostTemplate:] start parsing file /usr/local/lsws/conf/templates/phpsuexec.conf
    2018-05-27 17:45:40.428286 [INFO] [PlainConf] [virtualHostTemplate:] RCS checkin config file /usr/local/lsws/conf/templates/phpsuexec.conf0 OK.
    2018-05-27 17:45:40.428370 [INFO] [PlainConf] [virtualHostTemplate:] start parsing file /usr/local/lsws/conf/templates/rails.conf
    2018-05-27 17:45:40.435847 [INFO] [PlainConf] [virtualHostTemplate:] RCS checkin config file /usr/local/lsws/conf/templates/rails.conf0 OK.
    2018-05-27 17:45:40.435921 [NOTICE] [ZConfManager] No VHosts added, do not send!
    2018-05-27 17:45:40.436224 [NOTICE] [AutoRestarter] new child process with pid=17213 is forked!
    2018-05-27 17:45:40.436377 [NOTICE] [AutoRestarter] new child process with pid=17214 is forked!
    2018-05-27 17:45:40.436633 [INFO] Stop listener *:7080.
    2018-05-27 17:45:40.436704 [NOTICE] [child: 17213] Successfully change current user to nobody
    2018-05-27 17:45:40.436724 [NOTICE] Child: 17213] Core dump is enabled.
    2018-05-27 17:45:40.436753 [NOTICE] [Child: 17213] Setup swapping space...
    2018-05-27 17:45:40.436845 [NOTICE] [Child: 17213] LiteSpeed/1.4.31 Open starts successfully!
    2018-05-27 17:45:40.436862 [NOTICE] [child: 17214] Successfully change current user to nobody
    2018-05-27 17:45:40.436874 [NOTICE] Child: 17214] Core dump is enabled.
    2018-05-27 17:45:40.436891 [NOTICE] [Child: 17214] Setup swapping space...
    2018-05-27 17:45:40.436930 [NOTICE] [Child: 17214] LiteSpeed/1.4.31 Open starts successfully!
     
    Last edited by a moderator: May 30, 2018
  3. Will

    Will New Member

    Hmmmm I believe I may have fixed it by replacing RewriteRule ^ with RewriteRule ^/? :)
     
  4. Tishu

    Tishu Well-Known Member

    Hello,
    I see that you are using OLS and in this case ^/? should work.
     
  5. Will

    Will New Member

    @Tishu yes it does. Thank you so much for replying!
     

Share This Page