Forum Discussion
Greg_Bishop_104
Nimbostratus
Mar 15, 2009Redirect based on lists
Hi there, I think what I am aiming for is redirection based on two lists. So I'm thinking something like:
set uri [string tolower [HTTP::uri]]
set originallist [list "john" "sue" "nancy"]
set newlist [list "john2" "sue4" "nancy7"]
if { $uri ... in originallist }
HTTP::redirect http://www.domain.com/sites/...matching value from newlist
e.g. john goes to john2, sue goes to sue4, etc.
I would rather figure out how to do this than:
if { $uri equals "john" } { HTTP::redirect http://www.domain.com/sites/john2 }
elseif { $uri equals "sue" } { HTTP::redirect http://www.domain.com/sites/sue4 }
because these lists are going to be several hundred values long.
I apologize, I'm no programmer and I know zilch about matching, switching, arrays, lists, etc. Any help would be greatly appreciated!
Thanks,
Greg
- Patrick_Chang_7Historic F5 AccountProxypass iRule is your friend. http://devcentral.f5.com/wiki/default.aspx/iRules/ProxyPass.html
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