Este sitio web utiliza cookies para realizar análisis y mediciones de tus visitas. [ Acepto ] [ Más información aquí ].

How to Detect Tablets in your Website

To detect visits from tablets with PHP, download the file Mobile_Detect.php, and then add this condition to your website:

include 'Mobile_Detect.php';

$detect = new Mobile_Detect;

if ($detect->isTablet())

{

include 'tablet.html';

} else {

include 'computer.html';

}

In this case, tablet visitors will see the file tablet.html, and PC visitors will see computer.html. If you want to know how to detect mobile users, visit "How to Detect Mobile Phones in your Website".

You can also redirect mobile and tablets users to a specific folder or a specific subdomain with these .htacess codes:

Code to redirect tablet users to a folder:

RewriteEngine on

RewriteCond %{HTTP_USER_AGENT} Android|Blackberry|iPad|iPhone|ipod|

iemobile|opera\ mobile|palmos|webos|googlebot-mobile

RewriteCond %{REQUEST_URI} !^/Folder Name/

RewriteRule .* /Folder Name/ [R]

Code to redirect tablet users to a subdomain:

RewriteEngine on

RewriteCond %{HTTP_USER_AGENT} Android|Blackberry|iPad|iPhone|ipod|

iemobile|opera\ mobile|palmos|webos|googlebot-mobile

RewriteRule .* http://iphone.example.com/ [R]

Añadir comentario