Tuesday 30 July 2013

How To Redirect Mobile Users On Your Website

when someone from a mobile device visits a website, i want to redirect that person to a mobile website. Although our mobile platform does this natively, we thought it would be useful to share the redirection code.

It is best if this code is placed between and so it can be recognized first and redirect any mobile users quickly:

What this code does is it says, "If the screen size of the device viewing this website is less than 800 pixels wide, then redirect them to http://yourdomain.com/mobile/" (replace this with anything).

This can also be used to redirect mobile visitors to a YouTube video, a specific page on your website, or something else. A specific page on your website may be best (so they can still click around and access other parts of your website).

Update:

Since the sizes of mobile screens vary so much, it is best to detect by user agent. We suggest following these steps to set up more accurate mobile redirection:

1. Download the Javascript version from http://detectmobilebrowsers.com and save to desired folder (eg. /javascript). Let's name it redirect.js.

2. Edit redirect.js, find and change http://detectmobilebrowser.com/mobile to you mobile URL.

3. In your website header between and , add within head tags.


Source: http://notixtech.com/blog/how-redirect-mobile-users-your-website

1 comment:

  1. A specific page on your website may be best (so they can still click around and access other parts of your website). tcgseoservices.com

    ReplyDelete