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.


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 :slight_smile:

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.