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

Hien_Truong's avatar
May 04, 2021
Solved

irule redirect all except some path.

Hi, i need to redirect all wildcard uri except some uri. The below irule is working with wildcard (else condition) but not working with others (if and elseif) condition. Please help to fix this issu...
  • Enes_Afsin_Al's avatar
    May 04, 2021

    Hi Hien Truong,

    when HTTP_REQUEST {
    	if { [HTTP::host] equals "www.default.com" && not ([HTTP::uri] starts_with "/abc/def" || [HTTP::uri] starts_with "/xyz/w") } {
    		HTTP::respond 301 Location "https://otherdomain.com/redirect_legacy[HTTP::uri]"
    		return
    	}
    }