17-Sep-2021 05:01
Hi, im trying to use an irule to direct traffic from https://example.com to https://www.example.com, im using the following but it just wont work! Any suggestions appreciated!
when HTTP_REQUEST {
if {[string tolower [HTTP::host]] equals "example.com"} {
HTTP::respond 301 Location "https://www.[HTTP::host][HTTP::uri]"
}}
17-Sep-2021
14:22
- last edited on
04-Jun-2023
19:18
by
JimmyPackets
Hi cymru81,
This iRule should work. Is there any other irule attached in virtual server?
After adding the log lines, can you investigate the ltm logs?
when HTTP_REQUEST {
log local0. "wwwredirect1 | Host: [HTTP::host]"
if { [HTTP::host] equals "example.com" } {
log local0. "wwwredirect2 | Host: [HTTP::host]"
HTTP::respond 301 Location "https://www.[HTTP::host][HTTP::uri]"
return
}
}
21-Sep-2021 03:17
just checking the ltm log and this (obv replaced) is logged for the VS, if that could be relevant (2.2.2.2 being the VIP)?
SSL Handshake failed for TCP 1.1.1.1:35262 -> 2.2.2.2:443