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
https://forums.phpfreaks.com/topic/216798-help-with-http_user_agent_list/
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.

 

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.