CodeShare
Have some code. Share some code.
cancel
Showing results for 
Search instead for 
Did you mean: 
JCMATTOS_41723
Nimbostratus
Nimbostratus

Problem this snippet solves:

Are you tired of chewing up external public IP's well this iRule may be for you. This simple iRule will allow you to redirect clients to specific url's based on host header information, the default action will just redirect to HTTPS or whatever you choose. Enjoy!

Code :

when HTTP_REQUEST {
   switch -glob [string tolower [HTTP::host]] {
      "*abc*" {
         # add the redirect link ie "www.xyz.com"
         HTTP::redirect "https://www.xyz.com/xyz"
      }
      default {
         # add the default action you prefer ie "www.def.com"
         HTTP::redirect "https://[HTTP::host][HTTP::uri]"
      }
   }
}
Version history
Last update:
‎18-Mar-2015 16:05
Updated by:
Contributors