Forum Discussion
AlexBCT
May 04, 2021Cumulonimbus
If you have a look in the default redirect iRule on the F5 system ( _sys_https_redirect), you can see a nice example of how it roughly could look. If you then add your statement for filtering the correct domain name, as well as the .org-bit, it would look something like this:
when HTTP_REQUEST {
if { [string tolower [HTTP::host]] equals "example" } {
HTTP::redirect https://[getfield [HTTP::host] ":" 1].org[HTTP::uri]
}
}
You can remove the HTTP::uri and/or HTTP::host in the redirect and replace with the hardcoded domain name if you want, or you can use this format to keep it more flexible for other uses.
Hope this helps.