Forum Discussion
dbizzle_20930
Nimbostratus
Oct 01, 2012yet another redirect question
so heres my question. i have a simple irule that will redirect to a new host/uri based on the incoming request. however what i'm discovering is that apparently its not as simple as i had originally t...
Michael_Yates
Nimbostratus
Oct 01, 2012Hi Dave,
If you want to maintain any additional information in the [HTTP::uri] then you can just replace the host value and then perform a "string map" to replace the target values.
Also, do not include the URI::protocol in the switch comparison.
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host][HTTP::uri]] {
"some.host.com/singleuri*" {
HTTP::respond 301 Location "https://some.other.host.com[string map {"/singleuri" "/anotheruri"} [HTTP::uri]]"
}
}
}
Hope this helps.
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
