problem with rewrite-rules for redirection

ts77

Well-Known Member
#1
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?
 

mistwang

LiteSpeed Staff
#2
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.
 
Top