soymanue
Apr 20, 2013Nimbostratus
Regexp question
I want to build and iRule witch "SWITCH" command to make an URI based redirection.
If we have http://www.mydomain.com/URI y would need to redirect this way
if URI is "/marketing" or "/marketing/" -> Redirection 1
if URI is "/accounting" or "/accounting/" -> Redirection 2
if URI is "/humanresources" or "/humanresources/" -> Redirection 2
How would you check with regexp if a string is client1, client1/ . Something like client1[ "/ ", ]
Even better How would you check this:
"/MARKETING"
"/MARKETING/"
"/MARKETING/EN"
"/MARKETING/EN/"
"/HUMANRESURCES"
"/HUMANRESURCES/"
""/HUMANRESURCES/EN"
"/HUMANRESURCES/EN/"
I was thinking abut inserting a final "/" if the string doesn'f end with one.