windows - PHP UserAgent for IE 10.0 does not match -
the php redirect should working ie version 8 , below. version 9 working fine ie 10.0 not working code (looks ie 10.0 gets dismissed or etc.):
if ( preg_match("/(?i)msie [1-8]/",$_server['http_user_agent'])) { header("location: http://www.xyxyxyx.com"); } my goal be, redirecting should work ms ie 8 , below.
thanks alot.
edit2 / solution:
i should have changed code this:
if ( preg_match("/(?i)msie [1-8]\./",$_server['http_user_agent'])) { header("location: http://www.xyxyxyx.com"); } the trailing dot ensures version number 1 digit.
make sure check full version number.
if ( preg_match("/(?i)msie [1-8]\.0/",$_server['http_user_agent'])) { header("location: http://www.xyxyxyx.com"); } note ".0" suffix gets checked. way, you'll never need change code again versions of 10, 20, 30 or 80 might come.
ah, well, ie 5.5 once released...
if ( preg_match("/(?i)msie [1-8]\./",$_server['http_user_agent'])) { header("location: http://www.xyxyxyx.com"); } check after 1 single digit, there dot. if not dot, digit two-digit version number "10".
Comments
Post a Comment