F5_Redirect URI to external URL

Creating iRule for Redirection:

  1. Log in to the Configuration utility.
  2. Click Local Traffic.
  3. Click iRules—>iRule List
  4. Click Create…
  5. Type the name of the iRule
  6. Put the exact following content in the Definition dialog box:
  7. Click Finished.
Method:1
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
    }
}
Associate iRule to the virtual server

  1. Log in to the Configuration utility.
  2. Click Local Traffic.
  3. Click Virtual Servers.
  4. Click the virtual server you want to associate the iRule
  5. Click Resources.
  6. In the iRules section, click Manage.
  7. In the Resource Management section, move the appropriate HTTP class profile to Enabled
  8. Click Finished.
NOTE : For https website, need to offload SSL on the Virtual Server by adding a clientssl profile

No comments:

Post a Comment