Forum Discussion

cymru81's avatar
Icon for Altocumulus rankAltocumulus
Sep 17, 2021

https non www redirect

Hi, im trying to use an irule to direct traffic from to, im using the following but it just wont work! Any suggestions appreciated!



if {[string tolower [HTTP::host]] equals ""} {

HTTP::respond 301 Location "https://www.[HTTP::host][HTTP::uri]" 


3 Replies

  • 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 "" } {
    		log local0. "wwwredirect2 | Host: [HTTP::host]"
    		HTTP::respond 301 Location "https://www.[HTTP::host][HTTP::uri]"
  • 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?

  • just checking the ltm log and this (obv replaced) is logged for the VS, if that could be relevant ( being the VIP)?


    SSL Handshake failed for TCP ->