ohryan.ca

A Web Developer in Winnipeg

  • privacy
  • Modern Mobile Redirect Using .htaccess

    January 21, 2011
    in Tips & How To’s

    The following set of rewrite rules will redirect all Android, Blackberry, iOS, Windows and WebOS devices to a specific mobile directory on your website. Additionally, it will redirect Google’s mobile crawler – according to Google search spam czar Matt Cutts this is perfectly acceptable and even somewhat encourage.

    Code snippet – Simple .htaccess Mobile Redirect on Snipplr

    To implement these rules:

    1. Replace “mobiledirectoryhere” with the path to your mobile site. If your mobile site is located in a subdirectory, use the full URL (including “http://”) and you can omit the first RewriteCond.
    2. Then copy & paste the ruleset into the site’s .htaccess file or the main apache configuration.

    Rationale

    Since the last time I wrote about mobile browser detection and redirection in 2009 the mobile device landscape has changed once again. Smartphones dominate the mobile browsing landscape and feature phones are almost not existant in server logs.

    The old redirection rules I posted attempt to redirect every mobile phone under the sun. At this point in 2011, it’s probably safe to completely ignore ancient phones and simplify your Apache rules in the process.


  • Canadian Tech Roundup – Episode 9 – Netflix, CRTC, Shaw

    January 14, 2011
    in Canadian Tech News
    [podcast]http://dl.dropbox.com/u/480185/podcasts/CTR9.mp3[/podcast]
    • The Netflix Effect: Results From A Revealing Study in Canada
    • The federal government is appealing a court’s ruling that ordered it to make its websites accessible to visually impaired users
    • Microsoft Surface 2.0 Coming to RBC
    • Bell announces a new iptv service
    • Shaw’s wireless launch is delayed
    • Another wifi in schools story like we did a few weeks ago, except they’re going ahead with it
    • Canadian Recording Industry To Pay $45 Million To Settle Class Action Over Copyright Infringement

  • Lunch-hour Link Log

    January 11, 2011
    in Links
    • Recipe: Broccoli Curry Udon – Hungry?
    • Microsoft Surface 2.0 CES Demo – Coming to an RBC near you soon.
    • Angry Birds “board” game – I don’t get all the Angry Birds hype and this is just weird.
    • Facebook Blocker – Hate Facebook? Block it, everywhere!

←Previous Page Next Page→

Hi.

Hello, my name is Ryan! I’m a web developer in Winnipeg, Canada. I’ve been documenting my random thoughts and occasional bits of interesting code here since 2005. Twitter. Github. Instagram. Mastodon.

Recent Posts

  • How AI Stole My JobJune 30, 2025
  • Buy Canadian VegansApril 30, 2025
  • What is a “Note”?April 28, 2025
  • PortlandDecember 20, 2024
  • Thom Bargen, TuxedoDecember 10, 2024
  • VA CaféDecember 4, 2024

Designed with WordPress