Here are some simple directions how to update your web site for a mobile device using javaScript to detect and redirect your visitors.

  1. Create your a new subdirectory on your web server and call it m.yoursite.com
  2. Design your new mobile site
  3. Download this js file
  4. Add a link to the javaScript in the head of the your html website (not your mobile website):
    <script type=”text/javascript” src=”js/redirection_mobile.js”></script>
    (if you copy and paste from here please retype the quotes if necessary)
  5. Add this script after your <body> tag:
    <script>
    SA.redirection_mobile ({
    redirection_paramName:”mobile_redirect”,
    mobile_prefix : “m”,
    cookie_hours : “2”
    });
    </script>

    (if you copy and paste from here please retype the quotes if necessary)

If you want further details about this topic refer to the following links:
https://github.com/sebarmeli/JS-Redirection-Mobile-Site
http://blog.sebarmeli.com/2010/11/02/how-to-redirect-your-site-to-a-mobile-version-through-javascript/