RE: Rewriting/redirecting part of URL
Perfect, does exactly what I need. Thanks again Philipp. -Original Message- From: Philipp Buehler [mailto:e1c1bac6253dc54a1e89ddc046585...@posteo.net] Sent: 29 June 2017 12:50 To: Mark Holmes Cc: 'haproxy@formilux.org' Subject: RE: Rewriting/redirecting part of URL Am 29.06.2017 13:32 schrieb Mark Holmes: > This worked perfectly - thanks again Philipp - but now the goalposts > have moved slightly... > > > So what I need to do is > > If a request comes in for www.old.com/audi/thesite/pages > > I'd like to redirect to > > www.new.com/audi/thesite/pages > > maintaining everything after the first / > > > But if a request comes in for www.old.com/somethingelse > > I don't want to redirect, it should just end up on > www.old.com/somethingelse > > So basically, anything /audi gets redirected maintaining everything > after / > > Everything else doesn't get redirected. > > I can feel some kind or Regex situation here... > > Grateful for any suggestions. just more acl - now on the path. acl audimeh path_beg /audi acl oldthings hdr(host) -i old.com http-request redirect prefix https://new.com if oldthings audimeh -- pb This e-mail message is being sent solely for use by the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by phone or reply by e-mail, delete the original message and destroy all copies. Thank you.
RE: Rewriting/redirecting part of URL
Am 29.06.2017 13:32 schrieb Mark Holmes: This worked perfectly - thanks again Philipp - but now the goalposts have moved slightly... So what I need to do is If a request comes in for www.old.com/audi/thesite/pages I'd like to redirect to www.new.com/audi/thesite/pages maintaining everything after the first / But if a request comes in for www.old.com/somethingelse I don't want to redirect, it should just end up on www.old.com/somethingelse So basically, anything /audi gets redirected maintaining everything after / Everything else doesn't get redirected. I can feel some kind or Regex situation here... Grateful for any suggestions. just more acl - now on the path. acl audimeh path_beg /audi acl oldthings hdr(host) -i old.com http-request redirect prefix https://new.com if oldthings audimeh -- pb
RE: Rewriting/redirecting part of URL
This worked perfectly - thanks again Philipp - but now the goalposts have moved slightly... So what I need to do is If a request comes in for www.old.com/audi/thesite/pages I'd like to redirect to www.new.com/audi/thesite/pages maintaining everything after the first / But if a request comes in for www.old.com/somethingelse I don't want to redirect, it should just end up on www.old.com/somethingelse So basically, anything /audi gets redirected maintaining everything after / Everything else doesn't get redirected. I can feel some kind or Regex situation here... Grateful for any suggestions. Thanks! Mark -Original Message- From: Mark Holmes [mailto:mark.hol...@eu.biworldwide.com] Sent: 28 June 2017 19:01 To: 'Philipp Buehler' Cc: 'haproxy@formilux.org' Subject: RE: Rewriting/redirecting part of URL Great, I'll give that a go. Thanks Philipp! PS Don't feel sorry for me, I don't work for VWG group directly :) -Original Message- From: Philipp Buehler [mailto:e1c1bac6253dc54a1e89ddc046585...@posteo.net] Sent: 28 June 2017 18:37 To: Mark Holmes Cc: 'haproxy@formilux.org' Subject: Re: Rewriting/redirecting part of URL Am 28.06.2017 19:20 schrieb Mark Holmes: > Note that /audi/page/whatever will change all the time - essentially, > I want to preserve whatever comes after the first /, just rewriting > the domain part I feel bad for "Audi" (shouts from an ex-Daimler one.. :D ) now. With 1.6 you can just do that with 'http-request' and 'prefix': acl oldthings hdr(host) -i old.com http-request redirect prefix https://new.com if oldthings HTH, -- pb This e-mail message is being sent solely for use by the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by phone or reply by e-mail, delete the original message and destroy all copies. Thank you. This e-mail message is being sent solely for use by the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by phone or reply by e-mail, delete the original message and destroy all copies. Thank you.
RE: Rewriting/redirecting part of URL
Great, I'll give that a go. Thanks Philipp! PS Don't feel sorry for me, I don't work for VWG group directly :) -Original Message- From: Philipp Buehler [mailto:e1c1bac6253dc54a1e89ddc046585...@posteo.net] Sent: 28 June 2017 18:37 To: Mark Holmes Cc: 'haproxy@formilux.org' Subject: Re: Rewriting/redirecting part of URL Am 28.06.2017 19:20 schrieb Mark Holmes: > Note that /audi/page/whatever will change all the time - essentially, > I want to preserve whatever comes after the first /, just rewriting > the domain part I feel bad for "Audi" (shouts from an ex-Daimler one.. :D ) now. With 1.6 you can just do that with 'http-request' and 'prefix': acl oldthings hdr(host) -i old.com http-request redirect prefix https://new.com if oldthings HTH, -- pb This e-mail message is being sent solely for use by the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by phone or reply by e-mail, delete the original message and destroy all copies. Thank you.
Re: Rewriting/redirecting part of URL
Am 28.06.2017 19:20 schrieb Mark Holmes: Note that /audi/page/whatever will change all the time - essentially, I want to preserve whatever comes after the first /, just rewriting the domain part I feel bad for "Audi" (shouts from an ex-Daimler one.. :D ) now. With 1.6 you can just do that with 'http-request' and 'prefix': acl oldthings hdr(host) -i old.com http-request redirect prefix https://new.com if oldthings HTH, -- pb