Foros del Web » Creando para Internet » HTML »

[SOLUCIONADO] Bloquear acceso a android

Estas en el tema de Bloquear acceso a android en el foro de HTML en Foros del Web. hola a todos es que quiero blockiar todo los dispositivo android el acceso a mi web de que manera puedo ahcer esto....
  #1 (permalink)  
Antiguo 27/02/2015, 06:31
 
Fecha de Ingreso: junio-2012
Ubicación: En el Mundo
Mensajes: 759
Antigüedad: 11 años, 10 meses
Puntos: 10
Bloquear acceso a android

hola a todos es que quiero blockiar todo los dispositivo android el acceso a mi web de que manera puedo ahcer esto.
  #2 (permalink)  
Antiguo 27/02/2015, 07:12
Avatar de lauser
Moderator Unix/Linux
 
Fecha de Ingreso: julio-2013
Ubicación: Odessa (Ukrania)
Mensajes: 3.278
Antigüedad: 10 años, 9 meses
Puntos: 401
Respuesta: Blockiar acceso a android

Lo puedes hacer con MobileDetect
Lo incluyes en la pagina.
Código :
Ver original
  1. require_once ('Mobile_Detect.php');

Creas la instancia.
Código :
Ver original
  1. $detect = new Mobile_Detect();

Y recurres a las condicionales que necesites.
Código :
Ver original
  1. <?php
  2. if ($detect->isMobile()) {
  3. // Detecta si es un móvil
  4. }
  5. if ($detect->isTablet()) {
  6. // Si es un tablet
  7. }
  8. if ($detect->isAndroidOS()) {
  9. // Si es Android
  10. }
  11. if ($detect->isiOS()){
  12.  //Si es iOS
  13. }
  14. ?>
__________________
Los usuarios que te responden, lo hacen altruistamente y sin ánimo de lucro con el único fin de ayudarte. Se paciente y agradecido.
-SOLOLINUX-
  #3 (permalink)  
Antiguo 27/02/2015, 07:20
Avatar de chichote
Colaborador
 
Fecha de Ingreso: diciembre-2004
Ubicación: Santiago - Chile
Mensajes: 1.868
Antigüedad: 19 años, 4 meses
Puntos: 145
Respuesta: Blockiar acceso a android

Primera vez que leo que alguien quiere tener menos visitas jejejeje. Mediante HTML no es posible, debes, puedes hacerlo mediante javascript (aunque es fácilmente vulnerable), y también puedes hacerlo desde el lenguaje servidor que utilices, especifica que lenguaje utilizas y te podremos dar una mano, lauser ya te ha dado una solución para php.

Saludos.
__________________
http://chicho.ninja yiaaaa
  #4 (permalink)  
Antiguo 01/03/2015, 09:40
 
Fecha de Ingreso: junio-2012
Ubicación: En el Mundo
Mensajes: 759
Antigüedad: 11 años, 10 meses
Puntos: 10
Respuesta: Bloquear acceso a android

mira es que tengo un sistema que quiero que solo un dispositivo tenga acceso al la web que es el privado y utilizo php y html
  #5 (permalink)  
Antiguo 01/03/2015, 10:33
Avatar de sites  
Fecha de Ingreso: junio-2012
Mensajes: 230
Antigüedad: 11 años, 10 meses
Puntos: 7
Respuesta: Bloquear acceso a android

como va tu ingles? :)

Cita:
Deny visitors by referrer

The visitor blocking facilities offered by the Apache Web Server enable us to deny access to specific visitors based on where they have come from. If you've ever looked at your logs and noticed a surprising increase in traffic, yet no increases in actual file requests it's probably someone pinching content (such as CSS files) or someone attempting to hack your web site (this may simply mean trying to find non public content).

Note, this functionality requires that 'mod_rewrite' is enabled on your server. Due to the demands that can be placed on system resources, it is unlikely it is enabled so be sure to check with your system administrator or web hosting company.

To set-up block a single referrer, create a .htaccess file following the main instructions and guidance which includes the following text:

RewriteEngine on
# Options +FollowSymlinks
RewriteCond %{HTTP_REFERER} otherdomain\.com [NC]
RewriteRule .* - [F]

The above lines tell the Apache Web Server to block traffic from the URL 'otherdomain.com'. The '[NC]' text after the referrer specifies it as not case-sensitive. Which prevents traffic from 'OtherDomain.com', 'otherdomain.com', 'OTHERDOMAIN.COM' and so on.

To set-up block multiple referrers, create a .htaccess file following the main instructions and guidance which includes the following text:

RewriteEngine on
# Options +FollowSymlinks
RewriteCond %{HTTP_REFERER} otherdomain\.com [NC,OR]
RewriteCond %{HTTP_REFERER} anotherdomain\.com
RewriteRule .* - [F]

The above lines tell the Apache Web Server to block traffic from the URL 'otherdomain.com' and 'anotherdomain.com'. Note the backslash before the dot, this is important, e.g. 'domain\.com'. The only difference between blocking a single referrer and multiple referrers is the modified [NC, OR] flag in the multiple referrers example, this should be added to every domain except the last.

You might have noticed the line "Options +FollowSymlinks" above, which is commented with a '#'. Uncomment this line if your server returns a '500 Internal Server' error. This means your server isn't configured with FollowSymLinks in the '' section of the 'httpd.conf'. Contact your system administrator for advice with this issue.

Blocked referrers will be shown a '403 Forbidden' error message. You can customise this error message by following the 'Error Documents' section of this article.
source: http://www.htaccess-guide.com/deny-visitors-by-referrer/
  #6 (permalink)  
Antiguo 01/03/2015, 10:42
Avatar de lauser
Moderator Unix/Linux
 
Fecha de Ingreso: julio-2013
Ubicación: Odessa (Ukrania)
Mensajes: 3.278
Antigüedad: 10 años, 9 meses
Puntos: 401
Respuesta: Bloquear acceso a android

Cita:
como va tu ingles? :)
Y que tiene que ver, el denegar acceso a referidos con bloquear dispositivos móviles?
__________________
Los usuarios que te responden, lo hacen altruistamente y sin ánimo de lucro con el único fin de ayudarte. Se paciente y agradecido.
-SOLOLINUX-
  #7 (permalink)  
Antiguo 01/03/2015, 10:48
Avatar de lauser
Moderator Unix/Linux
 
Fecha de Ingreso: julio-2013
Ubicación: Odessa (Ukrania)
Mensajes: 3.278
Antigüedad: 10 años, 9 meses
Puntos: 401
Respuesta: Bloquear acceso a android

En htaccess... si acaso seria algo similar a esto:
Código Apache:
Ver original
  1. RewriteEngine On
  2. RewriteBase /
  3.  
  4. RewriteCond %{HTTP_USER_AGENT} (android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge\ |maemo|midp|mmp|mobile.+firefox|netfront|opera\ m(ob|in)i|palm(\ os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows\ ce|xda|xiino [NC,OR]
  5. RewriteCond %{HTTP_USER_AGENT} ^(1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a\ wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r\ |s\ )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1\ u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp(\ i|ip)|hs\-c|ht(c(\-|\ |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac(\ |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt(\ |\/)|klon|kpt\ |kwc\-|kyo(c|k)|le(no|xi)|lg(\ g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-|\ |o|v)|zz)|mt(50|p1|v\ )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v\ )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-|\ )|webc|whit|wi(g\ |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-) [NC]
  6. RewriteRule ^$ http://www.tuweb.es/404.htm [R,L]
__________________
Los usuarios que te responden, lo hacen altruistamente y sin ánimo de lucro con el único fin de ayudarte. Se paciente y agradecido.
-SOLOLINUX-
  #8 (permalink)  
Antiguo 01/03/2015, 13:57
Avatar de sites  
Fecha de Ingreso: junio-2012
Mensajes: 230
Antigüedad: 11 años, 10 meses
Puntos: 7
Respuesta: Bloquear acceso a android

Cita:
Iniciado por lauser Ver Mensaje
Y que tiene que ver, el denegar acceso a referidos con bloquear dispositivos móviles?
El texto que siguio es en Ingles, por ende dominarlo ayuda
  #9 (permalink)  
Antiguo 01/03/2015, 14:17
Avatar de lauser
Moderator Unix/Linux
 
Fecha de Ingreso: julio-2013
Ubicación: Odessa (Ukrania)
Mensajes: 3.278
Antigüedad: 10 años, 9 meses
Puntos: 401
A ese mismo texto me referia yo. No a el idioma en el que este escrito.
  #10 (permalink)  
Antiguo 01/05/2015, 11:19
 
Fecha de Ingreso: septiembre-2004
Mensajes: 6
Antigüedad: 19 años, 7 meses
Puntos: 0
Respuesta: Bloquear acceso a android

buenas se puede ahcer lo mismo pero que ingrese solamente los dispositivos con android? para lo demas se restrinja el ingreso?
  #11 (permalink)  
Antiguo 01/05/2015, 16:24
Avatar de NueveReinas  
Fecha de Ingreso: septiembre-2013
Ubicación: No tan Buenos Aires
Mensajes: 1.101
Antigüedad: 10 años, 7 meses
Puntos: 145
Respuesta: Bloquear acceso a android

Cita:
Iniciado por CharlesDarwin Ver Mensaje
buenas se puede ahcer lo mismo pero que ingrese solamente los dispositivos con android? para lo demas se restrinja el ingreso?
¿Qué método estás utilizando?
Si estás utilizando la condición de MobileDetect que puso lauser, simplemente compruebas si es diferente a Android, y si lo es bloqueas el acceso como sea que lo hagas.
__________________
¿Te sirvió la respuesta? Deja un +1
  #12 (permalink)  
Antiguo 02/05/2015, 04:32
Avatar de pzin
Moderata 😈
 
Fecha de Ingreso: julio-2002
Ubicación: Islas Canarias
Mensajes: 10.488
Antigüedad: 21 años, 9 meses
Puntos: 2114
Respuesta: Bloquear acceso a android

¿No es mejor mostrar un aviso de que se está ajustando el diseño y mostrar el contenido que restringir el acceso? Yo si veo un acceso restringido no vuelvo más a ese sitio, porque ya me queda en la cabeza que no podré acceder…
__________________
(:
  #13 (permalink)  
Antiguo 04/05/2015, 14:36
Avatar de Carlangueitor
Moderador ლ(ಠ益ಠლ)
 
Fecha de Ingreso: marzo-2008
Ubicación: México
Mensajes: 10.037
Antigüedad: 16 años, 1 mes
Puntos: 1329
Respuesta: Bloquear acceso a android

Y recuerden que el User-agent se puede cambiar y simular cualquier dispositivo.

Saludos
__________________
Grupo Telegram Docker en Español
  #14 (permalink)  
Antiguo 07/05/2015, 16:21
 
Fecha de Ingreso: septiembre-2004
Mensajes: 6
Antigüedad: 19 años, 7 meses
Puntos: 0
Respuesta: Bloquear acceso a android

Cita:
Iniciado por NueveReinas Ver Mensaje
¿Qué método estás utilizando?
Si estás utilizando la condición de MobileDetect que puso lauser, simplemente compruebas si es diferente a Android, y si lo es bloqueas el acceso como sea que lo hagas.
ok! y con el metodo .htaccess? como seria
  #15 (permalink)  
Antiguo 07/05/2015, 16:31
Avatar de Carlangueitor
Moderador ლ(ಠ益ಠლ)
 
Fecha de Ingreso: marzo-2008
Ubicación: México
Mensajes: 10.037
Antigüedad: 16 años, 1 mes
Puntos: 1329
Respuesta: Bloquear acceso a android

http://www.forosdelweb.com/f4/bloque...8/#post4684716
__________________
Grupo Telegram Docker en Español

Etiquetas: android, todo
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 18:23.