irules to rewrite old url to new url without changing the users browser url
Hi All
I am looking at the best way of performing a rewrite using an Irule, I had a google and found some examples and I haven't been able to get any to really work as expecting.
What I am trying to achieve is our devs are wanting to preserve the users browsers url (i.e. http://oldsite.test.com/test-site) but redirect the user to an alternate url (i.e. http://newsite.test.com/alternatesite/test) which is hosted via the same F5 but in a different pool.
I thought something like the below would achieve something along the lines but any pointers or suggestions would be extremely helpful:
when HTTP_REQUEST { if { [HTTP::uri] starts_with "/test-site" }{ HTTP::header replace "Host" "newsite.test.com" HTTP::path "/alternatesite/test" pool newsite-pool-HTTP } else { pool oldsite-pool-HTTP } }
Thanks in advance