Solved

mod_rewrite: redirect if Trident

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

896 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

15 Experts available now in Live!

Get 1:1 Help Now