«

»

Aug 21

iRule – 301 redirect on F5 LTM

In this example we going to redirect HTTP request coming for domain.com to http://www.domain.com using basic iRule.

Configuration steps:

1) Login to load balancer’s GUI

2) Go to Local Traffic -> iRules -> iRule List and click Create

3) Assign Name for iRule and paste enter irule code into Definition field. Once done press Finished.

4) Go to Local Traffic -> Virtual Servers -> Edit -> iRules – Manage -> select created iRule from a list and press << symbol -> Finished

iRule code

when HTTP_REQUEST {
    if { [HTTP::host] equals "domain.com" } {
        HTTP::respond 301 Location "http://www.domain.com"
    }
}

Follow me!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>