need a little help with redirection and expressions

ts77

Well-Known Member
#1
Hey folks,

I've moved some content from one subdomain to another which also changed the parameters a little bit.
So to avoid hitting the php-code I'd like to redirect in lsws directly but I'm having trouble with using the redirect context with expressions.

Essentially I have urls with
domain1.com/list.php?f=111
which changed to
domain2.com/list.php?111

I tried different expressions and none was successfull unfortunately. It seems to me as if I'm missing the obvious :(.

The current expression I'm trying is:
Code:
exp: ^/list.php?f=(.*)
with an external redirect and the target uri:
Code:
http://domain2.com/list.php?$1
whats wrong with that? I'm always still getting to the old php code on the page instead of getting redirected in lsws directly.
Oh, I'm on 2.2.6 with that machine btw.


thanks in advance,

thomas
 

mistwang

LiteSpeed Staff
#2
You need to move this matching context up above the first non-matching context to give it higher priority.
The context configuration looks fine.
 

ts77

Well-Known Member
#3
hmm, strange. its actually the *only* context I have in that vhost :).

Any way to trace that? toggle debug didn't give me any output beside the admin-vhost.
 

mistwang

LiteSpeed Staff
#4
I just realized There is a problem with your matching URI, it does not include query sting when matching the expression.

So, in this case, you have to use a Rewrite rule for this.
 

ts77

Well-Known Member
#5
ah, I knew I was missing the obvious ;).

but AFAIK rewrite engine also doesn't match on the query-string or am I wrong?


thanks,

thomas
 

ts77

Well-Known Member
#7
to match it yeah but I don't get a part of the query string in a variable I guess ;).

Seems like I'm doomed to use some script engine to handle that sanely.


thanks,

thomas
 
Top