04-Aug-2021
12:33
- last edited on
04-Jun-2023
19:21
by
JimmyPackets
I first tried doing this with a policy but that didn't work. When I added this iRule, both the customer and I tested and it worked fine. Now I'm getting error messages.
Professor X's website "professorx.xmen.com" is moving to "https://www.xmen.com/professorx"
There are multiple hosts that are moving to this virtual server, so I wanted to switch on the host and do the redirects. When I add a log message, it shows the $hostLowered as "professorx.xmen.com"
when HTTP_REQUEST priority 1 {
set host [HTTP::host]
set hostLowered [string tolower $host]
set uri [HTTP::uri]
set uriLowered [string tolower $uri]
switch -glob -- $hostLowered
{
"professorx.*" {
HTTP::redirect "https://www.xmen.com/professor-x-website"
}
}
}
Solved! Go to Solution.
04-Aug-2021 13:29
04-Aug-2021 13:29
Fixed by adding event disable after the redirect