httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kurtis Rader <kra...@skepticism.us>
Subject Re: [users@httpd] ReDirect question
Date Fri, 26 Jun 2015 20:36:30 GMT
On Fri, Jun 26, 2015 at 12:34 PM, Eric Covener <covener@gmail.com> wrote:

> On Fri, Jun 26, 2015 at 3:21 PM, James Moe <jimoe@sohnen-moe.com> wrote:
> > RewriteCond %{QUERY_STRING} app=ecom&ns=catshow&ref=books
> > RewriteRule ^
> >
> https://ya250.infusionsoft.com/app/storeFront/handleStoreFrontLink?displayType=Category&id=1&displayName=Books
> > [R=301,L]
>
> RewriteRule matches aginstt just the path, without the scheme host or
> query string.


That isn't the issue in this example. Notice that the rewrite rule pattern
is simply "^" which will match any path as it simply tests that the path
has a beginning (i.e., it anchors any subsequent part of the pattern to the
start of the path).

My question for James would be how do you know the query string has the
parameters in that exact order? Unless the query string has been
hand-crafted you cannot assume the parameters will appear in any specific
order. Also, your pattern doesn't handle the case where the parameters are
separated by semicolons (which is a legal alternative to ampersand). In
general matching against QUERY_STRING is very difficult to do in a robust
manner.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank

Mime
View raw message