Litespeed htaccess issue

Discussion in 'General' started by mcdl, Mar 19, 2014.

  1. mcdl

    mcdl Member

    I have done a lot of research, looked over a couple of hundred articles/forum posts but none fix my issues.

    Litespeed is not reading the .htaccess files in the site directories. It only reads from the server level.

    As you can see it should work according to the configuration on litespeed.
  2. NiteWave

    NiteWave Administrator

    they are 2 types of virtual host:
    1)vhost comes from apache's httpd.conf
    2)vhost from lsws's web admin

    if it's 1), please check first if .htaccess works under apache. if it works, it should work under litespeed.
  3. mcdl

    mcdl Member

    htaccess worked fine before the move to litespeed. I've even setup

    <Directory "/home/name/public_html">
    Options FollowSymLinks
    AllowOverride All

    Inside a vhost in apache. But this didn't work either.
  4. mistwang

    mistwang LiteSpeed Staff

    Please turn on debug logging, restart LSWS, access the site, check /usr/local/apache/logs/error_log if using cPanel, if not, check /usr/local/lsws/logs/error.log, it should have something about loading .htaccess, and process each directive in the log.
  5. mcdl

    mcdl Member

    Ok so I can see it can see the .htaccess file and it is updating it apparently. To litespeed's cache maybe?

    However this site runs on codeigniter and moving from another apache server to this litespeed on it is not working as it should. Whenever clicking a URL it returns 404 when the old server returned the correct page.
  6. mistwang

    mistwang LiteSpeed Staff

    There could be rewrite rule compatibility issue.
    What you can is to turn on rewrite log for that vhost, just add

    RewriteLogLevel 9

    to in <VirtualHost ...> </VirtualHost>

    temporarily, restart server, then check rewrite related log entries in the error.log.
    Post your rewrite rule may help identifying the problem.
  7. mcdl

    mcdl Member

    All that I could find was that the log was showing to GET the URL but I still returned a 404.

    Here's what's in the .htaccess

    DirectoryIndex index.php
    RewriteEngine on
    RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]

    Now the site is under a subdirectory. I could only find that it was processing the root directories .htaccess. No mention of the sub directories.
  8. mcdl

    mcdl Member

    Any help?
  9. NiteWave

    NiteWave Administrator

    can you try 4.2.8 and see if the issue still exists?
  10. mcdl

    mcdl Member

    No change
  11. mistwang

    mistwang LiteSpeed Staff

    Are you using native LSWS configuration or still load vhosts from Apache configuration?

    First, you need to make sure .htaccess was loaded in the debug logging.
    Make sure .htaccess permission is set correctly so it can be read by server process, need to make it world readable.
    try touch .htaccess see if server update it when next request comes in.

Share This Page