Forum Discussion

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

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
    	}
    }