jaddie_85451
Feb 15, 2017Nimbostratus
iRule syntax
Good morning
I am a novice at iRules and am having some issues with syntax of this iRule, this is the error I am getting in the iRules editior, any suggestions or help would be appreciated.
when HTTP_REQUEST {
if { ( [class match [string tolower [HTTP::header User-Agent]] contains useragentstoredirect]) }{
HTTP::redirect "https://xyz.sharepoint.com/Help/Pages/Supported-Browsers.aspx"
} else {
set redirect_path [URI::encode(“https://xyz.sharepoint.com[HTTP::uri]”)]
HTTP::respond 302 Location “https://login.microsoftonline.com/login.srf?wa=wsignin1.0&whr=xyz.com&wreply=$redirect_path“
}
}
Exception: Common::OperationFailed
primary_error_code : 17236305 (0x01070151)
secondary_error_code : 0
error_string : 01070151:3: Rule [/Common/iRuler_Parse_Test_Rule] error: /Common/iRuler_Parse_Test_Rule:1: error: [braces are required around the expression][when HTTP_REQUEST {
if { ( [class match [string tolower [HTTP::header User-Agent]] contains useragentstoredirect]) }{
HTTP::redirect "https://xyz.sharepoint.com/Help/Pages/Supported-Browsers.aspx"
} else {
set redirect_path [URI::encode(“https://wegmans.sharepoint.com[HTTP::uri]�)]
HTTP::respond 302 Location “https://login.microsoftonline.com/login.srf?wa=wsignin1.0&whr=xyz.com&wreply=$redirect_path“
}