For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

ERLomboy_27803's avatar
ERLomboy_27803
Icon for Nimbostratus rankNimbostratus
Sep 23, 2014

Consolidating iRule for multiple redirects using data group???

Hi Team,

 

Is there a way to consolidate multiple Vanity URLs that is redirected to a single URL aside from typing them one by one? I was looking at Data Group list but not sure how to incorporate it with the iRule script and what command to use? Appreciate the help!

 

example: www.mywebsite.com/links/page1 www.mywebsite.com/folders/reports www.mywebsite.com/contacts/

 

Redirect to http://www.mynewsite.com/consolidated/

 

1 Reply

  • Define your string-based data group like this (just the string, no value needed) -example name (my_uri_datagroup):

    /links/page1 := 
    /folders/reports := 
    /contacts/ :=
    

    Then your iRule might look something like this:

    when HTTP_REQUEST {
        if { [class match [string tolower [HTTP::uri]] starts_with my_uri_datagroup] } {
            HTTP::redirect "http://[HTTP::host]/consolidated/"
        }
    }