Rewrite not doing anything at all?

Discussion in 'Install/Configuration' started by pcguru, Dec 7, 2005.

  1. pcguru

    pcguru New Member

    Hello again. =)

    I'm trying to do some simple redirects with the rewrite feature on a virtual host. I've enabled rewirite in "Rewrite Control".

    I do not understand what "Rewrite Map" is for unfortunately, the help is just confusing about that section. I have not filled in anything here.

    I've added a rule to the "Rewrite Rules" section:
    RewriteRule ^test$ /index.php?var=test [R]

    Unforunately going to http://server/test simply gives a 404 error. What am I doing wrong? Using Litespeed 2.1.6.
  2. mistwang

    mistwang LiteSpeed Staff

    Full URL should be used in rewrite rules at vhost level, in your case, the rewrite rule should be:
    Code:
    RewriteRule ^/test$ /index.php?var=test [R]
    However, when you use rewrite rules in a .htaccess or at context level, you need to specify a parital URL relative to that directory or context, like the one you used.

    To debug a rewrite rule, you need to set Server error log "log level" to "info", and Rewrite "Log level" to "9", then you can find log messages in lsws/log/error.log to help you debugging your rules. :)

    George

Share This Page