18-Mar-2022 10:11
I have a number of different subdomains (wwwdev, wwwapps, things like that) and I want to use an iRule to force the domain from .com to .org.
Example force anyone that types in wwwdev.mydomain.com to arrive at wwwdev.mydomain.org
I've historically set this up using specific iRules for each subdomain, one on each farm. but that ends up being a lot of iRules that have to be updated when I'm sure I could just make one iRule that could be plugged in everywhere. I'm also pretty sure this is an easy fix but my googling just isn't cutting it.
Any help would be appreciated!
Thanks,
Mike
Solved! Go to Solution.
18-Mar-2022 16:31
Hi Mike,
Can you try this iRule?
when HTTP_REQUEST {
if { [HTTP::host] ends_with ".mydoamin.com" } {
HTTP::redirect https://[string map {".com" ".org"} [HTTP::host]][HTTP::uri]
return
}
}
18-Mar-2022 16:31
Hi Mike,
Can you try this iRule?
when HTTP_REQUEST {
if { [HTTP::host] ends_with ".mydoamin.com" } {
HTTP::redirect https://[string map {".com" ".org"} [HTTP::host]][HTTP::uri]
return
}
}
21-Mar-2022 08:16
Thanks for this, I've thrown it into dev and am checking it in a few places. So far so good!