Followers

How to Redirect Mobile/Tablet Users to another Site?


The mobile Web refers to the use of browser-based Internet services from handheld mobile devices, such as smartphones or feature phones, through a mobile or other wireless network. Mobile Internet growth is the growth of the Internet when accessed via a mobile phone, laptop, etc. Mobile phone connections are increasing more rapidly than purchases of any other consumer product, according to Tomi Ahonen. Since this article was published there were a number of announcements stating that half the world now had mobile phones. The articles in 2007-2008 were slightly misleading because the real story at the time was that the number of mobile phone subscriptions had reached half the population of the world. In reality many people have more than one subscription. For example, in Hong Kong, Italy and Ukraine, the mobile phone penetration rate has passed 140%. By 2009 even the number of unique users of mobile phones had reached half the planet, when the ITU reported that the subscriber number was to reach 4.6 billion user which means 3.8 billion activated mobile phones in use, and 3.4 billion unique users of mobile phones. The Mobile Internet data connections are following the growth of mobile phone connections albeit at a lower rate. In 2009 Yankee Group reported that 29% of all mobile phone users globally were accessing browser-based internet content on their phones. According to the BBC, there were over 5 billion mobile phone users in the world in 2010.
So, it means mobile users are growing up day by day. A website receive lots of visitor daily and well-nigh half visitors are accessing from their mobile or tablet. Sites or Blogs those are not responsive yet, of course faced a lot of problem, and as well as user too. This represent a site as a nerd in a class of stylish students. Well, there are two solutions of this major problem. Primary is - make your site responsible to fit in each and every size. And, other one is - redirect your site to another site that is responsible. However, in my this tutorial, I will show you that, 'How to Redirect Mobile/Tablet Users to another Site?' easily with some simple JavaScript Codes.

Features:
  • Cookies Enabled
  • Hypertext Transfer Protocol Scheme
  • Redirection Parameter
  • Tablet Redirection
  • and many more...

How to Redirect Mobile/Tablet Users to another Site?

#1: Add below codes in between <head> tag.
Javascript
<!-- Redirect mobile visitors by Design Devta-->
<!-- #### www.DesignDevta.Blogspot.Com #### -->
<script type="text/javascript" src="//hsinghhira.github.io/DesignDevta/Mobile_Redirect/redirection-mobile.js"></script>
<script type="text/javascript">
SA.redirection_mobile ({
 mobile_url: "designdevta.blogspot.com",
 cookie_hours: "2",
});
</script>
<!-- #### www.DesignDevta.Blogspot.Com #### -->
<!-- Redirect mobile visitors by Design Devta-->

#2: Customize above codes according to your needs.
#3: Done.

Configurations

  • mobile_prefix : prefix appended to the hostname. E.g. "m" to redirect to "m.domain.com". "m" is the default value if the property is not specified.
    mobile_url : mobile url to use for the redirection (without the protocol), such as "whatever.com"/example to redirect to "whatever.com/example". If "mobile_prefix" exists too, "mobile_prefix" is ignored. Empty string is the default value.
  • mobile_scheme : url scheme (http/https) of the mobile site domain, such as "https" to redirect to "https://m.domain.com". The protocol of the current page is the default value.
  • redirection_param : parameter to pass in the query string of the URL to avoid the redirection (the value must be equal to "false" to avoid redirection). Default value is "mobile_redirect". Eg: http://domain.com?mobile_redirect=false It is the name of the item in the sessionStorage (or cookie name) used to avoid mobile redirection.
  • cookie_hours : number of hours the cookie needs to exist after redirection to desktop site. "1" is the default value.
  • tablet_redirection : boolean value that enables/disables(default) the redirection for tablet such as iPad, Samsung Galaxy Tab, Kindle or Motorola Xoom. - Default:false. The value needs to be a string (so wrapped in double or single quotes). If 'tablet_host' parameter not specified, the user will be redirected to the same URL as for mobile devices.
  • tablet_host : hostname to use for the redirection in case user is using a tablet to access the site. Default value is ""
  • keep_path : boolean to determine if the destination url needs to keep the path from the original url. Default value is 'false'
  • keep_query : boolean to determine if the destination url needs to keep the querystring from the original url. Default value is 'false'
  • beforeredirection_callback : if specified, callback launched before the redirection happens. If a false value is returned from the callback the redirection doesn't happen.
  • append_referrer : boolean to determine if the document.referrer should be appended to the destination url. document.referrer will be URI encoded prior to appending. Default value is 'false'
  • append_referrer_key : if specified, the key used for the document.referrer. defaults to 'original_referrer'
Previous
Next Post »