Creating iRule for Redirection:
- Log in to the Configuration utility.
- Click Local Traffic.
- Click iRules—>iRule List
- Click Create…
- Type the name of the iRule
- Put the exact following content in the Definition dialog box:
- Click Finished.
when HTTP_REQUEST {
if {[HTTP::uri] contains”<Existing URI>"} {
HTTP::redirect “<TO BE REDIRECTED>”
}
}
Method:2
when HTTP_REQUEST {
if { [HTTP::host] eq "f5.com" } {
HTTP::respond 302 Location "http://cisco.com[HTTP::uri]" Connection Close
}
}
when HTTP_REQUEST {
if { [HTTP::host] eq "f5.com" } {
HTTP::respond 302 Location "http://cisco.com[HTTP::uri]" Connection Close
}
}
Associate iRule to the virtual server
- Log in to the Configuration utility.
- Click Local Traffic.
- Click Virtual Servers.
- Click the virtual server you want to associate the iRule
- Click Resources.
- In the iRules section, click Manage.
- In the Resource Management section, move the appropriate HTTP class profile to Enabled
- Click Finished.
NOTE : For https website, need to offload SSL on the Virtual Server by adding a clientssl profile
No comments:
Post a Comment