var ua = navigator.userAgent; if ((ua.match(/iPhone/i)) || (ua.match(/Android/i))) { location.replace("mwelcome.html"); }