Solved

mod_rewrite: redirect if Trident

Posted on 2014-03-12
3
285 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
  • 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
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). #…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

705 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now