Phillip Smith
coding

Note to self: A simple way to accomplish mobile site redirection using mod_rewrite

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.

About

Hi, I'm Phillip Smith, a veteran digital publishing consultant, online advocacy specialist, and strategic convener. If you enjoyed reading this, find me on Twitter and I'll keep you updated.

Related

Dear Internet, can we talk? We have an information pollution problem of epic proportions.

Misinformation and disinformation are not challenges specific to any single platform, or the responsibility of any single company: they r...… Continue reading