Solved

mod_rewrite: redirect if Trident

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
tomcat7  URL keeps resolving to https instead of HTTP 4 67
Website being blocked? 3 129
Guacamole and browser performance 1 105
Missing Apache mod_DBD packages in Centos 7 2 87
In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

856 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