I am struggling with some HAproxy rules for a while with no luck unfortunately.
Let's say I have domain1.com and domain2.com. I want to redirect everything from domain1.com to domain2.com, including subdomains and parameters.
Ex:
- foo.domain1.com => foo.domain2.com
- foo.domain1.com/?bar => foo.domain2.com/?bar
- domain1.com/?bar => domain2.com/?bar
- etc
I've tried with reqrep ^([^\ ]*\) (.*)domain1.com(.*) 1/ domain2.com\2
but it does not do the trick.
Any ideas?