Redirect iRule

Hi

please I want iRule to redirect

http://something.com/abc to http://anything.com/abc

thank you for help…

If you are using 11.4.0 or higher, you do not need to use an iRule. Instead, you can use a Local Traffic Policy:

If you are using a version before 11.4.0, you can use HTTP Classes:

Using one of these options is generally better than using an iRule. However, for completeness, here is an iRule to accomplish what you desire:

when HTTP_REQUEST {
    if { [string tolower [HTTP::host]] eq "something.com" } {
        HTTP::redirect "http://anything.com[HTTP::uri]"
    }
}

I assume here that you want to redirect any arbitrary URI path from source to destination, keeping the URI path intact on the redirect.