Jump to content

Help with HTTP_USER_AGENT_LIST


pquery

Recommended Posts

Friends,

 

I'm asking for a little help from those that already have these strings handy and could cut and paste a reply and save me a few hours of testing and reloading multiple versions of browsers on my test machines.

 

I'm trying to redirect those that are not using one of the compliant browsers which has been predetermined so these need to be determined in the HTTP_USER_AGENT lines such as

 

RewriteCond %{HTTP_USER_AGENT}  ^Mozilla/[345].*MSIE*
RewriteRule \var\www\html\htdocs\test\index.php$ [L]
RewriteRule ^index\.php$  [L]

 

If anyone has the HTTP_USER_AGENT line for the following browsers that they could share I would greatly appreciate it:

 

  • IE 6.0 / 7.0 / 8.0
  • Firefox 3.0 / 3.5 / 3.6
  • Safari 5.0

 

Thanks

Link to comment
Share on other sites

Well after reading through tons of log files, both access and error I finally have a working way of restricting my pre-approved browsers and I thought I'd post in case anyone else wanted to know how to do this task. (Also I had to add Chrome to my set of approved browsers since it seems to masquerade as Safari) I know Opera can spoof FF and IE but I'm mainly looking to deter mobile browsers and those that can't comply with the scripting rules in the pages which follow:

 

RewriteEngine On 
RewriteCond %{HTTP_USER_AGENT}  ^Mozilla/[5].*Safari/[533*]* [NC,OR]
RewriteCond %{HTTP_USER_AGENT}  ^Mozilla/[5].*Firefox/[3.*]* [NC,OR]
RewriteCond %{HTTP_USER_AGENT}  ^Mozilla/[4].*MSIE/[6.0]* [NC,OR]
RewriteCond %{HTTP_USER_AGENT}  ^Mozille/[4].*MSIE/[7]* [NC,OR]
RewriteCond %{HTTP_USER_AGENT}  ^Mozilla/[4].*MSIE*8* [NC]
RewriteRule ^test\$ http://mydomain.com/test/index2.php [L]

RewriteRule ^test\$ http:// /browser_redirect.php [L]
RewriteRule ^index\.php$ http://10.10.8.69/browser_redirect.php [L]

 

If anyone has a way to filter out Google chrome I'll take that suggestion.

 

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.