RewriteRule & Contexte

Discussion in 'Install/Configuration' started by xobul, Mar 17, 2005.

  1. xobul

    xobul New Member


    I wan't to import my rewrite apache config :

    RewriteRule ^/([a-g]+)(.+)$ /nodes/node0004/www/$1$2 [L]
    RewriteRule ^/([h-p]+)(.+)$ /nodes/node0006/www/$1$2 [L]
    RewriteRule ^/(.+)$ /nodes/node0001/www/$1

    but this don't work with Litespeed. I have make a test with static context and
    exp:^/([a-g]+)(.+)$ for the URI but i can't put $1 in location...

    where the solution ?

  2. mistwang

    mistwang LiteSpeed Staff

    Those rewrite rules should work, make sure you turned on the rewrite engine under the "rewrite" tab. If you already did, please turn on the rewrite log and check the lsws/logs/error.log

    As to the context, if you upgrade to the official 2.0 release, there should be no problem to use $x in location.

    Best Regards,
  3. xobul

    xobul New Member


    [REWRITE] Source URI: '/index.html' => Result URI: '/nodes/node0006/www/'

    in apache this rewrite rule rewrite to filesystem . "/nodes/node0006/www/" in my apache config is not an URI but full path.

    Best Regards,

    Note: All my tests is on lsws 2-pro
  4. mistwang

    mistwang LiteSpeed Staff

    LSWS will determine whether the rewritten URI is a file path or a url at later stage, but the target path must be somewhere under the document root of that virtual host.
    LSWS does not allow you to rewrite to an arbitrary location for security reason. You probably need to set document root to /nodes/ in your case.

    Please let me know if it fixes your problem. :)

Share This Page