problem with rewrite-rules for redirection

Discussion in 'Install/Configuration' started by ts77, Sep 13, 2006.

  1. ts77

    ts77 New Member

    Hey there,

    I'm running a couple of rewrite rules for my domains to avoid duplicate content.
    by accident I just found out that they are not working right now.
    Either I made an error in them or thats a new bug, therefore I'm looking for suggestions ;).

    The rules look all like that and are set in the litespeed-admin, not through .htaccess-files:
    Code:
    RewriteCond %{HTTP_HOST} ^domain\.de$ [NC]
    RewriteCond %{HTTP_HOST} ^www2\.domain\.de$ [NC]
    RewriteRule ^/(.*) http://www.domain.de/$1 [R=301,QSA,L]
    
    Which should lead to all requests from http://domain.de/something.html
    be redirected to http://www.domain.de/something.html

    but it simply doesn't do that.
    I've now set the rewrite log-level to 9 and in the log the result is the following:
    Code:
    [REWRITE] Rule: Match '/support.html' with pattern '^/(.*)', result: 2
    [REWRITE] Cond: Match 'domain.de' with pattern '^domain\.de$', result: 1
    [REWRITE] Cond: Match 'domain.de' with pattern '^www2\.domain\.de$', result: -1
    
    and no redirect is done.

    any ideas what I did wrong? or is that a bug?
  2. mistwang

    mistwang LiteSpeed Staff

    that's because the second request condition has not been met, maybe you should add an extra flag [OR] to the first rewrite condition, when either condition has been met, the rule will be executed.
  3. ts77

    ts77 New Member

    yep, that works, thx.
    so it was my fault in the end :).

Share This Page