Difference between revisions of "Change URL/Host"

From Tech-Wiki
Jump to: navigation, search
(Created page with "Category:F5 Networks '''Back to iRules''' when HTTP_REQUEST { set host [HTTP::host] set path [HTTP::path] if { not ([HTTP::host] starts_w...")
 
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:
  
 
  when HTTP_REQUEST {
 
  when HTTP_REQUEST {
  set host [HTTP::host]
+
  set host [HTTP::host]
  set path [HTTP::path]
+
  if { not ([HTTP::host] starts_with "www") } {  
  if { not ([HTTP::host] starts_with "www") } {  
+
    HTTP::redirect https://www.${host}
    HTTP::host www.[HTTP::host]
+
 
   }  
 
   }  
 
  }
 
  }

Latest revision as of 15: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}
  } 
}