HTTP_USER_AGENT Redirect all but Firefox

23Nov05

<?php
if (!stristr($_SERVER['HTTP_USER_AGENT'], "Firefox")) {
header( 'location:http://nostromo.no.funpic.org' );
exit();
}
echo('HTTP_USER_AGENT identified as Firefox');
?>

This code will (header) redirect anything that does not have “Firefox” in its HTTP_USER_AGENT (to location:) and will run the rest of the page otherwise (in this case it’ll print “HTTP_USER_AGENT identified as Firefox”).

Advertisements


%d bloggers like this: