Forum Discussion
William_Turner_
Dec 05, 2017Nimbostratus
Thoughts on if this iRule would meet the above needs and perform the correct 301 redirect?
when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
"some.example.com" {
if { [HTTP::uri] starts_with "/content"}{
set uri [HTTP::uri [string map {"/content" ""} [HTTP::uri]]]
HTTP::respond 301 Location "https://another.example.com$uri"
}
default {HTTP::respond 301 Location "https://another.example.com[HTTP::uri]"}
}
}