Forum Discussion
kolom_265617
Cirrostratus
Hello CraigyB, Try using the following iRule.
when HTTP_REQUEST {
if { ( [string tolower [HTTP::uri]] starts_with "/info" ) } {
set uri [HTTP::uri [string map {"/info" "/files"} [HTTP::uri]]]
HTTP::redirect "https://[HTTP::host]$uri"
}
}
kolom_265617
Jan 12, 2018Cirrostratus
i've tested the following and it's working fine.
when HTTP_REQUEST
if { ( [string tolower [HTTP::uri]] starts_with "/info" ) } {
set newUri [string map [list "info" "files"] [HTTP::uri]]
HTTP::redirect "http://[HTTP::host]$newUri"
}
if you want to replace the host/port , change the redirection part from HTTP::redirect "http://[HTTP::host]$newUri" to HTTP::redirect "http://10.10.10.10:9000$newUri"