Redirect users with mobile devices

English: Sharp Smartphone Android IS03 日本語: シャ...

There are a couple of different methods to re-direct users using mobile devices such as iPhones and Android phones to your mobile website.  One of the easiest way though is to add a simple bit of javascript to to the <HEAD> section of your web page.

This snippet of code will redirect the user to a different page based on their screen size.

<script type="text/javascript">
   if (screen.width<699) {

In this example a user browsing to your website with a screen size of less that 699 pixels wide will be redirected to the website (you can change this to your mobile website).

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.