Difference between revisions of "Change URL/Host"

From Tech-Wiki
Jump to: navigation, search
 
Line 3: Line 3:
  
 
  when HTTP_REQUEST {
 
  when HTTP_REQUEST {
  if { not ([HTTP::host] starts_with "www") } {  
+
  set host [HTTP::host]
    HTTP::host www.[HTTP::host]
+
  if { not ([HTTP::host] starts_with "www") } {  
 +
    HTTP::redirect https://www.${host}
 
   }  
 
   }  
 
  }
 
  }

Latest revision as of 14:19, 17 May 2021

Back to iRules

when HTTP_REQUEST {
 set host [HTTP::host]
 if { not ([HTTP::host] starts_with "www") } { 
   HTTP::redirect https://www.${host}
  } 
}