Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4849

Redirect Help to a subdomain

$
0
0

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.

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 4849

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>