Forum Discussion
Can someone explain this iRULE please?
ltm rule /Common/iRule-myweb.com_SharePoint { when HTTP_REQUEST { switch [string tolower [HTTP::host]] { "myweb.com" { switch -glob [string tolower [HTTP::uri]] { "/" - "" { switch -glob [string tolower [HTTP::header User-Agent]] { "iemobile" - "blackberry" - "symbian" - "androi" - "iphone" - "ipad" { ACCESS::disable HTTP::redirect "https://m.myweb.com/Home/MainMenu" } default { ACCESS::disable HTTP::redirect "https://www.myweb.com/" } } } } } "communitysapservice.myweb.com" { ACCESS::disable } "www.myweb.com" { switch -glob [string tolower [HTTP::header User-Agent]] { "robot" { ACCESS::disable } default { switch -glob [string tolower [HTTP::uri]] { "/_layouts/15/signout.aspx" - "/logout.apm" { ACCESS::session remove HTTP::redirect "https://www.myweb.com/Pages/home.aspx?message=LogOut" } "/pages/home.aspx?message=invalidsession" { if {$sid == ""} { log local0. "Invalid Session for IP: [IP::client_addr] calling [HTTP::host][HTTP::uri]" foreach x [HTTP::header names] { log local0. "header($x) = [HTTP::header $x]" } } } "/pages/home.aspx?message=logout" { log local0. "LogOut: [IP::client_addr] calling [HTTP::host][HTTP::uri]" } "/pages/home.aspx?message" { if {$sid != ""} { log local0. "Message-Query-String-Alert-IP: [IP::client_addr] calling [HTTP::host][HTTP::uri]" foreach x [HTTP::header names] { log local0. "header($x) = [HTTP::header $x]" } log local0. "SID = [ACCESS::session sid]" HTTP::redirect "https://www.myweb.com/Pages/home.aspx" } } "/mobile" { HTTP::redirect "https://m.myweb.com/Home/MainMenu" } "/_layouts/15/images/myweb/" - "/favicon.ico" { ACCESS::disable } "/" - "" { switch -glob [string tolower [HTTP::header User-Agent]] { "iemobile" - "blackberry" - "symbian" - "androi" - "iphone" - "ipad" { ACCESS::disable HTTP::redirect "https://m.myweb.com/Home/MainMenu" } } } default { log local0. "IP: [IP::client_addr] requested [HTTP::host][HTTP::uri]" foreach x [HTTP::header names] { log local0. "header($x) = [HTTP::header $x]" } log local0. "SID = [ACCESS::session sid]" } } } } } default { switch -glob [string tolower [HTTP::header User-Agent]] { "robot" { ACCESS::disable log local0. "IP: [IP::client_addr] requested [HTTP::host][HTTP::uri]" foreach x [HTTP::header names] { log local0. "header($x) = [HTTP::header $x]" } log local0. "SID = [ACCESS::session sid]" }
}
}
} } }
1 Reply
Your irule allow the BIG-IP to redirect mobile users to a different url than other users. Each action is logged.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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
