Redireccionar ne caso de mobile - Drupal 7
En caso de ser Drupal: en el index.php adicionar las siguientes lineas de códigos.
$u_agent = $_SERVER['HTTP_USER_AGENT'];
//print $u_agent;
if (preg_match('/up.browser|up.link|mmp|symbian|smartphone|android|midp|wap|phone|sony|nokia|samsung|windows ce|j2me|blackberry|palm|iphone|iPad/i',strtolower($_SERVER['HTTP_USER_AGENT']))){
//print 'mobile.'.$_SERVER['REQUEST_URI'];
if (($_SERVER['REQUEST_URI']) == '/node/569' || ($_SERVER['REQUEST_URI']=='/content/O-NUEVO-CARRO-NUEVO-CON-INCAUCA-LIGHT-E-INCAUCA-ZERO-0')) {
header( 'Location: /mobile/index.html') ;
exit;
}
}
$u_agent = $_SERVER['HTTP_USER_AGENT'];
//print $u_agent;
if (preg_match('/up.browser|up.link|mmp|symbian|smartphone|android|midp|wap|phone|sony|nokia|samsung|windows ce|j2me|blackberry|palm|iphone|iPad/i',strtolower($_SERVER['HTTP_USER_AGENT']))){
//print 'mobile.'.$_SERVER['REQUEST_URI'];
if (($_SERVER['REQUEST_URI']) == '/node/569' || ($_SERVER['REQUEST_URI']=='/content/O-NUEVO-CARRO-NUEVO-CON-INCAUCA-LIGHT-E-INCAUCA-ZERO-0')) {
header( 'Location: /mobile/index.html') ;
exit;
}
}

Comentarios
Publicar un comentario