Rewrite Engine does not pick up correct REQUEST_FILENAME when using PATH_INFO

Discussion in 'Bug Reports' started by dreamscape, Apr 18, 2007.

  1. dreamscape

    dreamscape New Member

    There is an odd problem in LiteSpeed 3.

    When using the Rewrite Engine, the REQUEST_FILENAME doesn't appear to be correctly set when using urls that have PATH_INFO.

    For example, the following Rewrite Rules worked fine on earlier versions of LiteSpeed, and they also work fine on other servers such as Apache and Lighttpd:
    Code:
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.+)$ index\.php/$1 [L,QSA]
    However, on LiteSpeed 3, it results in an infinite redirect (and throws a 500 error), because instead of being set to "index.php", the REQUEST_FILENAME is being set to "index.php" + the PATH_INFO.

    For now I have done the following which allows the rule to work on LiteSpeed 3:
    Code:
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !index\.php
    RewriteRule ^(.+)$ index\.php/$1 [L,QSA]
  2. mistwang

    mistwang LiteSpeed Staff

    The rewrite engine in LiteSpeed 3 has been changed a little bit to match the behavior of Apache's. We will investigate.
  3. mistwang

    mistwang LiteSpeed Staff

    This problem should be fixed in 3.0.3
  4. mistwang

    mistwang LiteSpeed Staff

    3.0.3 is available now.

Share This Page