Re: Tricky redirect... that needs help :)

2013-10-21 Thread Steven Le Roux
indeed this way it works... thx ! On Fri, Oct 18, 2013 at 6:07 PM, Willy Tarreau wrote: > On Fri, Oct 18, 2013 at 05:38:08PM +0200, Steven Le Roux wrote: > > Great willy as usual :) > > > > BUT :) > > > > There is still a / I can't remove... : got search=/ instead of > > search= > > The "/" is

Re: Tricky redirect... that needs help :)

2013-10-18 Thread Willy Tarreau
On Fri, Oct 18, 2013 at 05:38:08PM +0200, Steven Le Roux wrote: > Great willy as usual :) > > BUT :) > > There is still a / I can't remove... : got search=/ instead of > search= The "/" is automatically appended because the way the redirect works (if no path is found, redirect to "/"). But then

Re: Tricky redirect... that needs help :)

2013-10-18 Thread Steven Le Roux
Great willy as usual :) BUT :) There is still a / I can't remove... : got search=/ instead of search= On Fri, Oct 18, 2013 at 4:37 PM, Willy Tarreau wrote: > Hi Steven, > > On Fri, Oct 18, 2013 at 01:40:13PM +0200, Steven Le Roux wrote: > > frontend app > > bind *:80 > > acl p-static

Re: Tricky redirect... that needs help :)

2013-10-18 Thread Willy Tarreau
Hi Steven, On Fri, Oct 18, 2013 at 01:40:13PM +0200, Steven Le Roux wrote: > frontend app > bind *:80 > acl p-static url_reg ^/context$ > acl p-dyn url_reg ^/context/.*$ > reqrep ^GET\ /context/(.*) GET\ \1 if p-dyn > redirect code 301 location https://host.domain.tld/con

Re: Tricky redirect... that needs help :)

2013-10-18 Thread Steven Le Roux
frontend app bind *:80 acl p-static url_reg ^/context$ acl p-dyn url_reg ^/context/.*$ reqrep ^GET\ /context/(.*) GET\ \1 if p-dyn redirect code 301 location https://host.domain.tld/context if p-static use_backend app if p-dyn backend app redirect code 302 prefix http

Re: Tricky redirect... that needs help :)

2013-10-18 Thread Baptiste
Steven, In 1.5, the http-request rules are evaluated in the order they are written: " The http-request statement defines a set of rules which apply to layer 7 processing. The rules are evaluated in their declaration order when they are met in a frontend, listen or backend section. Any rule ma

Re: Tricky redirect... that needs help :)

2013-10-18 Thread Steven Le Roux
"It is important to know that http-request rules are processed very early in the HTTP processing, just after "block" rules and before "reqdel" or "reqrep" rules." I can't reqrep before redirecting. On Fri, Oct 18, 2013 at 8:00 AM, Baptiste wrote: > Hi steven, > > If you're using haproxy 1

Re: Tricky redirect... that needs help :)

2013-10-17 Thread Baptiste
Hi steven, If you're using haproxy 1.5, then use http-request rules. Otherwise you could run your redirect rules in a backend. Baptiste Le 17 oct. 2013 23:28, "Steven Le Roux" a écrit : > Hi, > > What I want to do is : > > acl p-static url_reg ^/context$ > acl p-dynamic url_reg ^/context/.*$ >

Tricky redirect... that needs help :)

2013-10-17 Thread Steven Le Roux
Hi, What I want to do is : acl p-static url_reg ^/context$ acl p-dynamic url_reg ^/context/.*$ reqrep ^([^\ ]*)\ /context/(.*) \1\ /\2 if p-dynamic redirect code 301 location http://host.domain.tld/context if p-static redirect code 301 prefix http://host.domain.tld/contex/ressource?id= if p