Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CGI variables -<CFIF CGI.HTTP_USER_AGENT IS IE8 OR IE9>

Participant ,
Aug 15, 2012 Aug 15, 2012

I need to find code that if a user is using Internet explorer 5, Internet explorer 6, Internet explorer 7 or Internet explorer 8 they get redirected to one page and if the are using any other browser including IE9  they go to another.

Something like this

<CFIF CGI.HTTP_USER_AGENT IS IE5 OR CGI.HTTP_USER_AGENT IS IE6 OR CGI.HTTP_USER_AGENT IS IE7 OR CGI.HTTP_USER_AGENT IS IE8 >

<cflocation go here>

<cfelse>

<cflocation go here>

</cfif>

Any help ?

2.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Aug 15, 2012 Aug 15, 2012

Go to this Web page to see a full list of http_user_agent for Internet Explorer.

http://www.useragentstring.com/pages/Internet%20Explorer/

<cfif cgi.http_user_agent CONTAINS "MSIE 5"

     OR cgi.http_user_agent CONTAINS "MSIE 6"

     OR cgi.http_user_agent CONTAINS "MSIE 7"

     OR cgi.http_user_agent CONTAINS "MSIE 8">

     <!--- redirect to page A --->

<cfelse>

     <!--- redirect to page B --->

</cfif>

As you can see, there is a pattern in the user agent string. You might want to use Regular Expression

...
Translate
Engaged ,
Aug 15, 2012 Aug 15, 2012
LATEST

Go to this Web page to see a full list of http_user_agent for Internet Explorer.

http://www.useragentstring.com/pages/Internet%20Explorer/

<cfif cgi.http_user_agent CONTAINS "MSIE 5"

     OR cgi.http_user_agent CONTAINS "MSIE 6"

     OR cgi.http_user_agent CONTAINS "MSIE 7"

     OR cgi.http_user_agent CONTAINS "MSIE 8">

     <!--- redirect to page A --->

<cfelse>

     <!--- redirect to page B --->

</cfif>

As you can see, there is a pattern in the user agent string. You might want to use Regular Expression (Regex) to simplify the conditional clause.

<cfif

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources