Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

How to redirect site with www for without www

Hello everyone,

I'd like to redirect one url using irule. I'd like to redirect de "https://www.site1.com.br"; for example, for "https://site1.com.br"; (without "www.";). How can I do this using irule? Thanks.

0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

The simplest way:

when HTTP_REQUEST {
    if { [string tolower [HTTP::host]] equals "www.site1.com.br" } {
        HTTP::redirect "https://site1.com.br[HTTP::uri]"
    }
}

You can use other ways to do the same -> https://devcentral.f5.com/questions/simple-url-redirect-irule

KR, Dario.

0