Hey everyone I'm using a code I found in another question that says it was answered correctly and working. It's not working for me though and I have tried it out on multiple devices.
The full code can be found here(this is the code library): https://raw.githubusercontent.com/serbanghita/Mobile-Detect/master/Mobile_Detect.php
The question is here: Best way to redirect single php page for mobile devices with PHP/Javascript
And my code is:
<?php require('includes/mobileRedirect.php'); ?>
<?php
$detect = new Mobile_Detect;
if ( $detect->isMobile() ) {
header('Location: http://m.jollyrogerpcs.com/');
exit;
}
?>
The problem seems to be around the "header" area. If I replace the header with a echo('mobile'); it works, but no matter what I do I cannot seem to get mobile to redirect.
EDIT: Problem solved by moving the code before the DOCTYPE.