RE: Redirection based on source URL (using parameters)?

From: RODRIGUEZ Unai <Unai.Rodriguez#music-group.com>
Date: Mon, 11 Jul 2011 01:13:54 +0000

Thank you so much

--
Kind Regards,

RODRIGUEZ Unai
Senior Administrator, Systems
MUSIC Group Services SG (Pte.) Ltd
IP Phone: 60651 ext 1825
Tel: +65 6845 1800 ext 1825
Email: INFOServSystSG#music-group.com
Web: www.music-group.com | www.behringer.com | www.bugera-amps.com

youtube.com/behringer twitter.com/behringer facebook.com/behringer myspace.com/behringer flickr.com/behringerrocks

* Build Teamwork  * Take Ownership  * Dont Waste Resources  * Clean Workplace = Clean Mind  * Respect Guidelines and Policies  * Improve Yourself and Help Others  * Dont Forget to Smile and Say Thank You

This email is intended exclusively for the addressee(s) named above and may contain privileged and confidential information. If you are not (among) the intended recipient(s), you may not copy, utilize or distribute any of the information contained herein. If you have received this email in error, please notify us immediately via return email and delete the original from your mailbox. Thank you.

________________________________________
From: Willy Tarreau [w#1wt.eu]
Sent: Saturday, July 09, 2011 1:49 PM
To: RODRIGUEZ Unai
Cc: haproxy#formilux.org
Subject: Re: Redirection based on source URL (using parameters)?

Hi Unai,

On Wed, Jul 06, 2011 at 03:29:06PM +0000, RODRIGUEZ Unai wrote:
> Dear All,
>
> I am trying to set up redirection rules that use part of the source URL on the destination URL. Example:
>
> /(..)/home.htm -> /home/$1
>
> Is it possible to do this in HAProxy? Would you please throw some pointers on how?

Yes, you can do it just like sed, using "\1". For instance :

    reqrep ^([^\ ]*)\ /([^?]*)/home.htm\ (.*)  \1\ /home/\2\ \3

Above, \1 is the method, \2 is the path before /home.htm (and it does not look
for it in query string), and \3 is the HTTP version.

Hoping this helps,
Willy

Received on 2011/07/11 03:13

This archive was generated by hypermail 2.2.0 : 2011/07/11 03:30 CEST