Forum Discussion
youssef1
Sep 25, 2018Cumulonimbus
Hi,
If you want a generic Irule, you can use something like that:
when HTTP_REQUEST {
set host [string tolower [HTTP::host]
if {!($host starts_with "www.") and ($host ends_with "com")} {
set host2 "www.[string tolower [HTTP::host]"
HTTP::header replace Host $host2
}
}
if you want use redirect just replace:
HTTP::header replace Host $host2
by
HTTP::redirect "https://$host2[HTTP::uri]"