Redirection iRule Request for subsites
Hello
I am pretty new to F5 and would like to see if someone can help me with a redirection iRule.
The redirection should retain path after the second location or the subsites. So I am looking for something like:
1. when going to http://abcsp/sites/apps should be redirected to https://apps.abcsharepoint.example.com/
2. when going to http://abcsp/sites/apps/SomethingSomething should be redirected to https://apps.abcsharepoint.example.com/SomethingSomething
3. when going to http://abcsp/Anythingotherthansites should be redirected to https://abcsharepoint.example.com/
What I have in place right looks something like this:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::host]] {
"abcsp" {
if { [HTTP::uri] starts_with "/sites/apps/" } {
HTTP::redirect "https://apps.abcsharepoint.example.com/"
}
elseif { [HTTP::uri] starts_with "/" } {
HTTP::redirect "https://abcsharepoint.example.com/"
}
}
}
}
This is doing only 1 and 3. 2 is missing...
Thanks in advance!