I have this written this iRule and it is appears not to be working, it blocks the first line only and when I switch the order firefox with msie 8.0 it blocks all of ie.
Any suggestions why this would not be working or a better way to do this…
Thanks -Steve
when HTTP_REQUEST {
Check if the client is an firefox browser
if {[string tolower [HTTP::header value User-Agent]] contains "msie 8.0"}{
HTTP::respond 302 Location "https://company.sharepoint.com/Help/Pages/Supported-Browsers.aspx"
} elseif { [string tolower [HTTP::header value User-Agent]] contains "firefox"} {
HTTP::respond 302 Location "https://company.sharepoint.com/Help/Pages/Supported-Browsers.aspx"
} elseif { [string tolower [HTTP::header value User-Agent]] contains "msie 9.0"} {
HTTP::respond 302 Location "https://company.sharepoint.com/Help/Pages/Supported-Browsers.aspx"
} elseif { ( [HTTP::cookie exists SITEA] ) } {
HTTP::respond 302 Location https://company.sharepoint.com[HTTP::uri]
} else {
HTTP::respond 302 Location "https://spo.xyzapps.com/Help/Communication/LoginExperience/Internal/Internal_1.html" "Set-Cookie" "SITEA=1;path=/"
}
}
Yes I meant redirect, basically what happens is that if I put firefox in the first if statement it redirects as anticipated but not to any other browser type specified below in the elseif …if I put MSIE 8.0 is the first statement it redirects all IE versions of browsers not just 8 or 9.
So two problem I guess. 1. Does not seem to want to go to next if statement 2. Does not seem to want recognize the IE version type
I guess I am looking for a better way to do this and very my agent definition statement
Thank you both for your assistance, with your help I figured out what the issue was, the IE browser was being represented as a different version number due to Comparability (which I was assured was not being used) - my bad on assuming.
Anyway we figured it out and in the process used the following iRule.
Thank you both for your assistance
when HTTP_REQUEST {
Check the user agent
if { ( [class match [string tolower [HTTP::header User-Agent]] contains useragentstoredirect]) }{
HTTP::respond 302 Location "https://company.sharepoint.com/Help/Pages/Supported-Browsers.aspx"
} elseif { ( [HTTP::cookie exists SITEA] ) } {
HTTP::respond 302 Location https://company.sharepoint.com[HTTP::uri]
} else {
HTTP::respond 302 Location "https://spo.companyapps.com/Help/Communication/LoginExperience/Internal/Internal_1.html" "Set-Cookie" "SITEA=1;path=/"
}
}
useragentstoredirect = data group list