Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

internet browsers sniffing/redirecting

Hey Guys,

Is there a way to redirect if users are coming in to the VirtualServer with IE or Firefox or Blackberry

I would like to redirect users with IE to one URI(www.test.com/IE) and all others to another(www.test.com/OTHER).

let me know if you have run in to this before, Thanks for any help.
0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER
You could look up the common User-Agent strings and then issue a redirect to a specific URI using a switch statement. However, your current description would result in every client request being redirected to some default page.

Do you want to redirect just requests for the root document to these custom pages? Here's an example that implements that logic:


when HTTP_REQUEST {
if {[HTTP::path] eq "/"}{
switch -glob [string tolower [HTTP::header User-Agent]] {
"*ie user-agent string*" -
"*another ie user-agent string*" {
HTTP::redirect http://[HTTP::host]/IE/ }
"*firefox user-agent string*" {
HTTP::redirect http://[HTTP::host]/FF/ }
default {
HTTP::redirect http://[HTTP::host]/other/ }
}
}
}


Aaron
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER
Ok, so I can redirect with for all IE versions to the main page, then default will cover all the rest.

thanks for your help, you have to LOVE F5....

YOU CAN DO IT!!!
0