Forum Discussion
https non www redirect
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]"
}}
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 } }
- cymru81Altocumulus
Hi, thanks for the reply - no other irules are applied.
if i enable the logging, where can i pickup the logs from to review please?
- cymru81Altocumulus
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
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com