[thelist] Mobile Redirect

Hassan Schroeder hassan.schroeder at gmail.com
Mon Nov 10 17:44:55 CST 2008

On Mon, Nov 10, 2008 at 8:10 AM, Ben Dyer <radicalbender at gmail.com> wrote:

> I've got a regular site (www.example.com) and a mobile-specific site (
> m.example.com). I'd like to have it where if you visit the regular site with
> a mobile browser that you are redirected to the mobile site, but still have
> the option to go back to the regular site. By way of example, this is what
> Twitter does.
> I was initially looking at using an .htaccess file on the regular site to
> accomplish this, but I don't think that will work because a mobile user will
> be bounced back to the mobile site if they try to click over to the regular
> site.
> Any suggestions? Maybe cookies or session variables?

It seems to me you'll have to use cookies to save the preference, so
the mobile user can choose and stay there.

That said, I have no idea if there are mobile user agents that don't
accept cookies, which would require URL rewriting to maintain that
preference on a session basis.

It *appears* the cookie-based approach works on my G1, though
that's obviously a small part of the mobile population at this point.

Hassan Schroeder ------------------------ hassan.schroeder at gmail.com

More information about the thelist mailing list