I’m trying to write an iRule to display a warning message when a user is trying to access our internal SharePoint intranet with a non-supported browser (such as Firefox - which is popular amongst our devs). I want this message to be displayed once per day and if the user clicks on “Continue” I’d like the F5 to redirect him to whatever address he was trying to access.
My problem is that I do not know the syntax for the irule.
I suppose it will be something +/- like this
when HTTP_REQUEST {
if { not ( [HTTP::cookie exists BANNERMESSAGE] ) AND [HTTP::header "User-Agent"] contains "mozilla"]} {
set expires [clock format [clock seconds] -format "%A, %d-%b-%Y 20:00:00"]
HTTP::respond 200 content "
Unsuppored browser
Dear Users,
You are using a non supported browser to access SharePoint.
If you use this browser not all SharePoint funtionalities will be available to you.
Please also note that the Helpdesk will only accept cases if using Internet Explorer.
Click to continue anyway
" "Set-Cookie" "WRONGBROWSER=1; path=/; expires=$expires"
What I do not know is :
How to do a IF statement on two conditions (IF the WRONGBROWSER cookie does not exist AND if User-agent contains Mozilla THEN …)
How to capture the address the user was trying to reach and provide in my HTML page a link “Click here to continue” which would redirect the user to that specific address.
OK for some reason the iRule is not properly displayed, so here’s a stripped down version without the HTML code
when HTTP_REQUEST {
if { not ( [HTTP::cookie exists WRONGBROWSER] ) AND [class match [HTTP::header "User-Agent"] contains "Mozilla"]} { set expires [clock format [clock seconds] -format "%A, %d-%b-%Y 20:00:00"]
HTTP::respond 200 content "
HTML
click here to continue (with a link to https://whatever_he-was_trying_access
/HTML
" "Set-Cookie" "WRONGBROWSER=1; path=/; expires=$expires"
}
}
I used “mozilla” because I did not know what else to use. Basically what I want to do is display that page to users using Firefox. Which user agent should I use then?
OK so assuming my syntax is correct I’d have something like the iRule below. How can I capture the address entered to the user so I can redirect him to that address once he click “Continue” on the warning page?
when HTTP_REQUEST {
if { not ( [HTTP::cookie exists WRONGBROWSER] ) AND [class match [string tolower[HTTP::header "User-Agent"]] contains "firefox"]} {
set expires [clock format [clock seconds] -format "%A, %d-%b-%Y 20:00:00"]
HTTP::respond 200 content "
HTML
click here to continue (with a link to https://whatever_he-was_trying_access
/HTML
" "Set-Cookie" "WRONGBROWSER=1; path=/; expires=$expires"
}
}
Could you post the updated iRule for this Redirect. I am working for displaying the compatibility for TLS 1.2 instead of TLS 1.0/TLS 1.1
Here is my iRule but. I don’t want to direct to some other page, i want to display same warning to update the user about TLS and redirect to the same URI.
when RULE_INIT { set static::refresh_time 15 set static::unsupported_browser_page { System Notification http://www.xxx.com">
System Notification
You are using an unsupported browser. You must use internet explorer 10.0 or higher