您好,感谢您提前帮忙。重定向到基于Haproxy路径的新域名
我在我的旧网站上有一个博客,我正试图使用haproxy将所有帖子重定向到他们在我的新网站上的新位置。例如,我想https://www.oldsite.com/john-blog/blogpost1被301重定向到https://www.newsite.com/jill-blog/blogpost1。
https://www.oldsite.com/john-blog =>https://www.newsite.com/jill-blog
frontend https
option http-server-close
reqadd X-Forwarded-Proto:\ https
acl is_ob path_sub john-blog
redirect location https://www.newsite.com/jill-blog code 301 if is_ob
我已经弄清楚如何转发流量/john-blog
但一直无法弄清楚如何做重写,这样/john-blog/blogpost1
旧网站301重定向到/jill-blog/blogpost1
在新网站上。
谢谢@JamesStewy。 – Jay
@JamesStewy,我有一个类似的http重定向请求,但无法使其工作 - https://stackoverflow.com/questions/48583664/how-to-redirect-url-using-haproxy – newbie