LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Install/Configuration > problem with rewrite-rules for redirection

Reply
 
Thread Tools Display Modes
  #1  
Old 09-13-2006, 06:33 AM
ts77 ts77 is offline
Senior Member
 
Join Date: Nov 2004
Posts: 288
Default problem with rewrite-rules for redirection

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?
Reply With Quote
  #2  
Old 09-13-2006, 09:56 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,583
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.
Reply With Quote
  #3  
Old 09-13-2006, 09:59 AM
ts77 ts77 is offline
Senior Member
 
Join Date: Nov 2004
Posts: 288
yep, that works, thx.
so it was my fault in the end .
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Rewrite Problem Jetro General 6 03-26-2007 01:27 PM
problem with rewrite & 404 error xinn Install/Configuration 6 06-21-2006 10:45 AM
Rewrite before reverse proxy? jburks725 Install/Configuration 1 01-18-2006 12:17 PM
rewrite problem illidan Install/Configuration 4 04-18-2005 03:42 PM
rewrite content limit Channel_Cat Bug Reports 1 09-21-2004 03:37 PM


All times are GMT -7. The time now is 04:31 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.