pquery Posted October 25, 2010 Share Posted October 25, 2010 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 Quote Link to comment Share on other sites More sharing options...
pquery Posted October 27, 2010 Author Share Posted October 27, 2010 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.