How To Detect And Redirect To Mobile Site Using PHP?

If you don't want to use javascript, you can handle it via php. Take a look at this lib: And then you could do something like this code:

include 'Mobile_Detect.php';
$detect = new Mobile_Detect();

if ($detect->isMobile()) {
    header('Location: yourpage.php');

This library is reliable and usable until today. It's great. I hope you find this short-blog useful. If you want to get new posts, make sure to subscribe to Value In Brief by Email.