Technical Forum
Ask questions. Discover Answers.
Showing results for 
Search instead for 
Did you mean: 

iRule Redirection Help




I have a peculiar situation that I'm trying to figure out if iRules can pull off for me but I'm not sure about the approach here. For context, we have one DNS entry pointing directly to a server (we'll call this and another DNS entry that points to an F5 VIP (we'll call this Our client wants to have it where end users who enter get redirected to I believe with iRules this wouldn't be possible unless we created a F5 VIP for and change the DNS entry to point to this new F5 VIP. So a new F5 https VIP was created that didn't load balance to anything but just existed so that the DNS entry for could point to it. So I'm looking for a method to be able to redirect end users who enter to I thought this would be possible with something like this:



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

  if { [HTTP::path] equals "/something" } { 

   HTTP::redirect ""





There's also an iRule applied to the VIP that points to for redirecting users who enter to, which is currently working. The idea was to have an iRule applied to the VIP of to redirect end users entering to and then the other iRule applied to the VIP that points to would handle the redirect to However, this isn't working as planned and I'm not as knowledgeable with iRules to figure out alternatives.


Hi  ,


You can try below iRule -


when HTTP_REQUEST { if { [HTTP::host] equals "" }{ if { [HTTP::uri] contains "something" }{ HTTP::redirect "" } } }


Also below is the irule which will also help to redirect to the uri along with the host. So you shouldn't require separate irule to redirect to the uri if you want to keep same uri path.


when HTTP_REQUEST { if { [HTTP::host] equals "" }{ if { [HTTP::uri] contains "something" }{ HTTP::redirect "[HTTP::uri]" } } }

Also if your F5s are running on 14.1.0 or later version, kindly consider -


Hope it helps!

Okay, I tried both of those iRule options and neither worked. We still receive an error message of 'ERR_CONNECTION_RESET'.

 Could you please check the article given above and see if it is applicable to you?