I'm just setting up some new whitelabels with pimproll (great job BTW guys as usual

)
Which works best and doesn't harm your SEO?
Code:
<script type="text/javascript">
if (navigator.userAgent.match(/(opera mini|ipod|iphone|up.browser|up.link|mmp|symbian|smartphone|midp|wap|vodafone|o2|pocket|kindle|mobile|psp|treo|nokia|blackberry|pre\/0.1|android)/i)) {
// default for all other mobile browsers
location.replace("http://nameofthedomaincom/");
}
</script>
or,
Code:
<?php
if (preg_match('/(opera mini|ipod|iphone|up.browser|up.link|mmp|symbian|smartphone|midp|wap|vodafone|o2|pocket|kindle|mobile|psp|treo|nokia|blackberry|pre\/0.1|android)/i', $_SERVER['HTTP_USER_AGENT'])) {
header('Cache-Control: no-transform');
header('Vary: User-Agent, Accept');
header('Location: http://domaingoeshere.com');
exit;
}
?>
Or is there a better more SE friendly way to do it?
Just double checking here, i'm sure either of the ways above will work perfectly.
Thanks for any help
