Forum Discussion

gsingh10_135426's avatar
gsingh10_135426
Icon for Nimbostratus rankNimbostratus
Nov 25, 2013

iRule redirection based on URI

Guys, this redirection based on URI is not working, need some help. I have external Data group text File redirurls with URI in it "/sites/jjtest/Test_Bed/default.aspx",

 

And iRule - when HTTP_REQUEST { set redirect [class match -value [string tolower [HTTP::uri]] equals redirurls] if {$redirect ne ""} { HTTP::redirect "http://xxxx.ent.xxxxx.com/$redirect" } }

 

7 Replies

    • gsingh10_135426's avatar
      gsingh10_135426
      Icon for Nimbostratus rankNimbostratus
      01070151:3: Rule [/Common/xxxx_redirects] error: line 2: [wrong args] [class lookup -value [string tolower [HTTP::uri]] equals redirurls] Error!
  • nathe's avatar
    nathe
    Icon for Cirrocumulus rankCirrocumulus

    You could probably use a HTTP Class profile for this I would've thought.

     

    Your iRule looks ok thought. What happens?

     

    Hope this helps,

     

    N

     

  • We have close to 1000 URLS that we need to migrate, and I saw example of scaling these referencing to external file. (text file, type String) with following URI

     

    "/sites/jjtest/Test_Bed/default.aspx",

     

    Redirection is not working.

     

    Any Idea?

     

    • nathe's avatar
      nathe
      Icon for Cirrocumulus rankCirrocumulus
      do you see any more details in the browser, e.g. fidder / http fox?
  • If I may add, you're testing with a [string tolower ] URI value, but the data group entry is not all lowercase, so it will never match. Otherwise your iRule looks okay.