I am working on a mobile creation website where I need to redirect user to mobile version of site when they are on mobile device. So basically there will be two sites.. One is for Browsers in PC and another is mobile version. If someone opens main website in mobile device than we need to track it and redirect to mobile version of site.
For this, I have a quick and easy solution. I am just taking screen width and if it is less than 600px than it must be mobile device or ipad. so we will redirect it to mobile version of url.