F5 is upgrading its customer support chat feature on My.F5.com. Chat support will be unavailable from 6am-10am PST on 1/20/26. Refer to K000159584 for details.

Forum Discussion

RobS's avatar
RobS
Icon for Altostratus rankAltostratus
Nov 05, 2019
Solved

iRule help for two redirects based off uri with variable

Hi,   I'm trying to create an iRule that does the following redirects:   http://xxx.com/ -> https://yyy.com/find-a-provider/ http://xxx.com/Home/Physician?profileId=UserValue -> https://yyy....
  • Enes_Afsin_Al's avatar
    Nov 05, 2019

    Hi RobS,

    Can you try this iRule?

    when HTTP_REQUEST {
    	switch -glob [HTTP::uri] {
    		"/" {
    			HTTP::redirect "https://yyy.com/find-a-provider/"
    		}
    		"/Home/Physician?profileId*" { 
    			set UserValue [URI::query [HTTP::uri] profileId]
    			# log local0. "profileId = $UserValue"
    			HTTP::redirect "https://yyy.com/find-a-provider/physician/$UserValue"
    		}
    	}
    }