SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2010
    0 Post(s)
    0 Thread(s)

    Mobile site redirect, then link back to full-site

    I have an index.html (homepage) file that I would like to redirect to my mobile version if viewed on mobile devices. I have found some good JS code that will perform this task...but my problem is redirecting out of the mobile site if the user clicks the link to "continue to full site". The JS code overrides this option and the user is stuck in the mobile version.

    Any help on this would be greatly appreciated.


  2. #2
    Under Construction silver trophybronze trophy AussieJohn's Avatar
    Join Date
    Sep 2005
    Sydney, Australia
    11 Post(s)
    0 Thread(s)
    If you're using JavaScript to do the detection it's probably going to be relatively basic, and you might find a few false positives get thrown in the wrong direction. To get some proper mobile detection happening, I would recommend using the WURFL Project that will require some server side coding however. If it's a big deal to get it right, it would probably be worth investing the extra time :-)

    Regardless of that though, to solve your problem of people getting redirected back and forth you could set a cookie for visitors that land on the mobile site, on your main page you could then check for this cookie, and if it's present you wouldn't redirect them because they will have already been to the mobile site.
    var details = {
    . . web: "",
    . . photos: "",
    . . psa: ""


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts