Forum Discussion
kolom_265617
Jan 12, 2018Cirrostratus
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"
}
}
- CraigyB_172365Jan 12, 2018Nimbostratus
Hi Kolom, appreciate your input, which parts do i replace with destination host name and port number?
- kolom_265617Jan 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"