Forum Discussion
jgoetsch_236444
Nimbostratus
Jun 24, 2016URL 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...
Vijay_E
Cirrus
Jun 25, 2016Client 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
DevCentral Quicklinks
* 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
Discover DevCentral Connects