Re: Detect and Redirect Mobile Users

From: Date: Thu, 13 Jun 2013 12:45:51 +0000
Subject: Re: Detect and Redirect Mobile Users
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-321391@lists.php.net to get a copy of this message
Hi, On Thu, Jun 13, 2013 at 1:19 AM, dealTek <dealtek@gmail.com> wrote: > Hi all, > > I'm curious of a simple, common, universal way to detect a mobile user so > I can redirect them to a mobile directory... > > What is best for this: Javascript - CSS - PHP? > > I think for my purposes if I can detect screen size or mobile browser > agent - that would be good enough for what I need right now. > > Thanks in advance - Dave > > In my personnal experiences, I've used varnish (for caching mainly) and for mobile redirection purpose. A few line in your vcl configuration and there you go. You can even put a rules to indicate that if there is a GET parameter or a cookie, you don't redirect the user. It means that you can simply add a link on your mobile website to send the user back on the desktop website if he prefers. I like this approach as it is directly on your first frontend (or load balancer) and you don't even need to load you php app to redirect the user. Regards, -- bacardi55 (bacardi55.org)

« previous php.general (#321391) next »