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

Ema's avatar
Ema
Icon for Nimbostratus rankNimbostratus
Aug 23, 2019
Solved

Irule for www removal on https

I would like to remove the www from the url but is having some issues with the code on one of my vip. I currently have 2 vips: 1 is for http redirection to https with that includes the www ...
  • Enes_Afsin_Al's avatar
    Aug 29, 2019

    Hi,

    Can you try this iRule in browser's incognito mode?

    when HTTP_REQUEST {
        if {[string tolower [HTTP::host]] starts_with "www."}{
            log local0. "hostname = [HTTP::host]"
            HTTP::redirect "https://[substr [HTTP::host] 4][HTTP::uri]"
        }
    }