14-May-2020 07:49
I have used redirect before and they have worked but can't get this rule to work.
When a user browses to abc.co.uk i want to change the URL in the browser bar to www.abc.co.uk. i have tried the following without success:
when HTTP_REQUEST {
if { [HTTP::host] equals "skipton.co.uk/" } {
HTTP::header replace "Host" "https://www.skipton.co.uk/"
}
}
*with the / on the end
when HTTP_REQUEST {
if { [HTTP::host] equals "skipton.co.uk"}
{ HTTP::header replace Host "www.skipton.co.uk"
}
}
*without the / on the end
when HTTP_REQUEST {
if { [HTTP::host] equals "skipton.co.uk" } {
HTTP::redirect "https://www.skipton.co.uk[HTTP::uri]"
}
}
Can anyone see why it does not work and how to fix it? Much appreciated.
14-May-2020
08:53
- last edited on
24-Mar-2022
01:22
by
li-migration
,
Below iRule looks good, it should work.
when HTTP_REQUEST {
if { [HTTP::host] equals "skipon.co.uk" } {
HTTP::redirect "https://www.skip.co.uk[HTTP::uri]"
}
}
Check under iRule statistics if you are seeing hits to it.
Mayur