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

Mike_Monti's avatar
Mike_Monti
Icon for Nimbostratus rankNimbostratus
Mar 18, 2022
Solved

iRule that saves subdomain

I have a number of different subdomains (wwwdev, wwwapps, things like that) and I want to use an iRule to force the domain from .com to .org.  Example force anyone that types in wwwdev.mydomain.com ...
  • Enes_Afsin_Al's avatar
    Mar 18, 2022

    Hi Mike,

    Can you try this iRule?

    when HTTP_REQUEST {
    	if { [HTTP::host] ends_with ".mydoamin.com" } {
    		HTTP::redirect https://[string map {".com" ".org"} [HTTP::host]][HTTP::uri]
    		return
    	}
    }