1

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.

1 Answer 1

1

This may help

acl blog_path path_beg -i /blog/
redirect location http://blog.example.com  append-slash code 301 if blog_path

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .