Forum Discussion

Tyson_James's avatar
Tyson_James
Icon for Altostratus rankAltostratus
May 24, 2018

Very simple iRule to specific URI....

I am new to iRules and am trying to do a simple "redirect" of sorts. I have the need for anyone going to https://server.domain.com/anything-beyond-the-slash be "redirected" to the the virtual servers' pool, but add text to the URI. Below is what I have tried so far and it is not working :

when HTTP_REQUEST {
  if {[string tolower [HTTP::host]] starts_with "server.domain.com" && [HTTP::path] contains "/"} {
    HTTP::uri "/add-this-text/[HTTP::uri]"
  }
}

Any assistance is greatly appreciated.

1 Reply

  • Figured it out. It was working the entire time, but we had "require AD authentication" turned on for the website. Once we realized that, we were good. Thanks.