In PHP how can I check if a desktop browser is viewing my mobile site and redirect to the desktop site?
I have a microsite that's mobile only and if a desktop hits it I want to redirect to the main company home page.
I tried this:
if(strpos($useragent,'Windows') == true || strpos($useragent,'Mac') == true)
header( 'Location: http://you.tc' ) ;
But on iphone it's redirecting to the home site and should stay on mobile. I'm assuming there is something else in the user agent I need to check.