I\'m sure this gets asked a lot, but I also know things change quite frequently, so I am wondering what the current best way to do a simple mobile detection and redirection
<script type="text/javascript">
function checkBrowser(){
var str=navigator.appVersion;
var patt1=/Android/;
var patt2=/iPhone/;
if(str.match(patt1) || str.match(patt2)){
window.location="http://m.yoursite.com";
}
}
</script>
then on the body-tag put onload="checkBrowser();"
it's a very simple way to do it, but i'm sure there plenty more ways.. hope it helps :)