Forum Discussion
Gill_32697
Nimbostratus
Feb 10, 2014uri redirects
So i need to redirect to website based on a uri. I have about 100 redirect and I my need to add, remove or edit from time to time. Below is what I have but is giving me an error when I save in editor...
Kevin_Stewart
Employee
Feb 10, 2014For that many records, I'd use a data group> This way you never have to touch the iRule.
-
Create a string-based data group. Example (my_uri_dg)
"/bob" := "https://weblet.mysites.com/mortgage/default.aspx?ClientID=11039" "/sue" := "https://weblet.mysites.com/mortgage/default.aspx?ClientID=11039" -
Create this iRule (modify as required):
when HTTP_REQUEST { if { [class match [string tolower [HTTP::uri]] equals my_uri_dg] } { HTTP::redirect [class match -value [string tolower [HTTP::uri]] equals my_uri_dg] } }
This will redirect the client to the correct URL based on the request URI.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects