Forum Discussion
Sam10
Jul 23, 2020Altostratus
url redirect irule
I am trying to get an irule working for redirecting a url to a different one. When users connect *.host1.abc.com it needs to redirect to *.host2.xyz.com when HTTP_REQUEST { if { [clas...
Jul 23, 2020
Hi Sam10,
Can you try this?
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] contains "host1.abc.com" } {
set host [string map -nocase {"host1.abc.com" "host2.xyz.com"} [HTTP::host]]
HTTP::redirect "http://$host[HTTP::uri]"
}
}
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