I am trying to redirect one url example.com/blog to blog.example.com using haproxy. I have applied following rule:
acl blog_path path_beg -i /blog/
redirect location http://blog.example.com/ code 301 if blog_path
The redirection is working fine, but there is one glitch which I am not able to solve.
If I type example.com/blog/ in the browser, it is successfully redirected to blog.example.com but if I type example.com/blog without / in the end it is redirecting to blog.example.com/blog which should not happen and is pretty strange to me. Any idea how can I solve this.