We are moving our news articles from our main web site to a new blog sub domain. I’m trying to get the redirection to work in HAProxy, but having some issues. I’m running 1.5 on a CentOS 7 server. What I’m wanting to do is change
https://www.example.com/news/post/sample_page
to
https://blog.example.com/sample_page
Here’s what I’ve got so far.
acl newspage url_beg /news/post/
http-request redirect code 301 location https://blog.example.com%[capture.req.uri] if newspage
But I need to strip out the /news/post part of the uri. That’s where I’m stuck.
I’ve tried
[capture.req.uri,regsub(^/news/post,)]
but that just puts me at the root, it doesn’t preserve the specific page.
Thanks.