Forum Discussion
URL Rewrite to another domain
Hi All,
I am attempting to perform a URL rewrite in our F5 BigIP load balancer. This needs to be a URL rewrite to another domain, redirects will not work. I have attempted the following but it is currently not working, it simply directs the request to IIS without performing the rewrite.
when HTTP_REQUEST { if { ( $low_uri equals "/test-page" ) or ( $low_uri equals "/test-page/" )} then { HTTP::header replace "Host" "test.example.com" } }
Thank you,
Jason
1 Reply
- Vijay_E
Cirrus
Client sends "abcd.com", it is changed to "xyz.com" and sent to servers. Reply from servers is "xyz.com" and it is changed to "abcd.com" and sent to clients.
Use this as an example and modify it to suit your requirements:
when HTTP_REQUEST { if { [HTTP::host] contains "abcd.com" } { HTTP::host [string map {abcd.com xyz.com} [HTTP::host]] } when HTTP_RESPONSE { if { [HTTP::header values Location] contains "xyz.com" } { HTTP::header replace Location [string map {xyz.com abcd.com} [HTTP::header value Location]] } }
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com