Solved

mod_rewrite: redirect if Trident

Posted on 2014-03-12
3
305 Views
Last Modified: 2014-03-14
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} "MSIE [6-8]" [NC]
RewriteRule ^(.*)$ http://mysite.com/ie [R=301,L]

Open in new window

That works on some versions of Internet Explorer but not others.  Some versions of Internet Explorer identify themselves as as Mozilla!

Here is an example:
Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/5.0)

Open in new window


Is there a way to form a Rewrite Condition to apply if the word: "Trident" occurs in the user agent definition?
0
Comment
Question by:hankknight
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 42

Accepted Solution

by:
David S. earned 500 total points
ID: 39924299
They all identify themselves as Mozilla, as do most other web browsers. Older versions just say "Mozilla/4.0" instead of "Mozilla/5.0". I recommend you read Lest We Forget (Or How I Learned What’s So Bad About Browser Sniffing).

Are you sure that you want to redirect all versions of IE? Are you using the X-UA-Compatible header to force newer versions to use compatibility modes? Wouldn't it be easier to fix the compatibility issues than to make and maintain two different copies of each page?
0
 
LVL 16

Author Comment

by:hankknight
ID: 39926338
Yes, I understand what I want.  How can I detect "Trident"?
0
 
LVL 42

Expert Comment

by:David S.
ID: 39926787
Then would you help us to understand why you want that?
0

Featured Post

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Apache,  not running php on top level 14 78
.htaccess file settings 4 74
LINUX CENTOS + APACHE 9 75
Need To Change Centos 6 Timestamp Form In Log File 24 128
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question