In preparation for the launch of The Tyee’s mobile-friendly site (not to be confused with The Tyee’s HTML5 “app” for mobile devices), I did some research on approaches to mobile site redirection. The key considerations were straightforward:
- The redirection should happen quickly
- The redirection should be as simple as possible
- There should be a way for the user to enable/disable the redirection
The solution I ended up with, based largely on this blog post, is as basic as I could get it. It relies on cookies for persistence of the user’s choice to view the mobile site, or the full site, but it also works properly without cookies when the user is simply switching between the mobile view and the full site view.
There you go. :) Your mileage may vary.
Remaining questions for me are:
- How long to persist the mobile site vs. full site cookie?
- How to let users know that they can change back to the mobile site from the full site? (Lots of options here.)
Have suggestion or improvements? Drop me a note or a comment.
Comments
2 Comments
> How to let users know that they can change back to the mobile site from the full site? (Lots of options here.)
If you're after an Apache implementation you could do a BrowserMatch to set an environment variable
http://httpd.apache.org/docs/2.2/mod/mod_setenvif.html#browsermatch
Then use an environment variable to conditionally include a big link to the mobile version
http://httpd.apache.org/docs/current/mod/mod_include.html#substitution
Hey there Charlie,
Thanks for the suggestion. That's roughly what I was thinking. However, the full site is actually using PHP not mod_include, so I'll probably just check for the existence of the fullsite cookie and throw up a big banner or something.
Still looking for good artifacts/examples of how other sites are flagging this, and how "obvious" to be about it without getting obnoxious.
Phillip.