{"id":9200,"date":"2020-02-06T09:45:18","date_gmt":"2020-02-06T08:45:18","guid":{"rendered":"https:\/\/blog.unelink.es\/?p=9200"},"modified":"2020-02-06T09:45:21","modified_gmt":"2020-02-06T08:45:21","slug":"cortar-ips-de-determinados-paises-usando-htaccess","status":"publish","type":"post","link":"https:\/\/hosting.airetech.es\/blog\/wiki\/cortar-ips-de-determinados-paises-usando-htaccess\/","title":{"rendered":"Cortar IPs de determinados pa\u00edses usando .htaccess"},"content":{"rendered":"\n<p>Si quieres que tus dominios <strong>no tengan visitas de alg\u00fan pa\u00eds concreto<\/strong>, puedes <strong>bloquearlas utilizando el fichero .htaccess<\/strong>. Esto puede resultar muy \u00fatil para evitar robots o crawlers de algunos pa\u00edses que lo \u00fanico que hacen es sobrecargar tu sitio web. Si no tienes p\u00fablico objetivo en esos pa\u00edses, lo mejor es bloquear el acceso desde ellos.<\/p>\n\n\n\n<p>Para hacerlo lo primero que tienes que conocer son los <strong>rangos de IPs<\/strong> que corresponden a cada pa\u00eds. Hay una herramienta online muy \u00fatil para ello y es la p\u00e1gina:<\/p>\n\n\n\n<p><a href=\"https:\/\/www.countryipblocks.net\/acl.php\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (se abre en una nueva pesta\u00f1a)\">https:\/\/www.countryipblocks.net\/acl.php<\/a><\/p>\n\n\n\n<p>En ella <strong>selecciona los pa\u00edses<\/strong> que quieres bloquear.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/seleccion-paises.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"567\" height=\"829\" src=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/seleccion-paises.jpg\" alt=\"\" class=\"wp-image-9201\" srcset=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/seleccion-paises.jpg 567w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/seleccion-paises-205x300.jpg 205w\" sizes=\"auto, (max-width: 567px) 100vw, 567px\" \/><\/a><figcaption>Selecci\u00f3n pa\u00edses<\/figcaption><\/figure><\/div>\n\n\n\n<p>En la columna Select Format selecciona <strong>Apache .htaccess Deny<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/seleccion-formato.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"374\" height=\"643\" src=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/seleccion-formato.jpg\" alt=\"\" class=\"wp-image-9202\" srcset=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/seleccion-formato.jpg 374w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/seleccion-formato-174x300.jpg 174w\" sizes=\"auto, (max-width: 374px) 100vw, 374px\" \/><\/a><figcaption>Selecci\u00f3n formato<\/figcaption><\/figure><\/div>\n\n\n\n<p>Pulsa <strong>Create ACL<\/strong> para generar las l\u00edneas que tendr\u00e1s que introducir en el .htaccess.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/create-acl.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"376\" height=\"528\" src=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/create-acl.jpg\" alt=\"\" class=\"wp-image-9203\" srcset=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/create-acl.jpg 376w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/create-acl-214x300.jpg 214w\" sizes=\"auto, (max-width: 376px) 100vw, 376px\" \/><\/a><figcaption>Create ACL<\/figcaption><\/figure><\/div>\n\n\n\n<p>En la parte derecha ver\u00e1s las <strong>l\u00edneas generadas con las IPs<\/strong> de los pa\u00edses seleccionados. Pulsa en el bot\u00f3n <strong>Copy ACL to Clipboard<\/strong> para copiar el contenido en el portapapeles.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/acl-results.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"470\" height=\"636\" src=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/acl-results.jpg\" alt=\"\" class=\"wp-image-9204\" srcset=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/acl-results.jpg 470w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/acl-results-222x300.jpg 222w\" sizes=\"auto, (max-width: 470px) 100vw, 470px\" \/><\/a><figcaption>Copy ACL to Clipboard<\/figcaption><\/figure><\/div>\n\n\n\n<p>Ahora tienes que <strong>copiar esas l\u00edneas en el fichero .htaccess del dominio<\/strong> para el que quieres bloquear las visitas de esos pa\u00edses. Hay muchas formas de hacerlo, por ejemplo, bajando el fichero por FTP y volverlo a subir modificado o utilizando el panel de control de tu servidor (cPanel, Plesk, etc). En este ejemplo <strong>vamos a ver c\u00f3mo hacerlo usando cPanel<\/strong>.<\/p>\n\n\n\n<p>Por tanto, <strong>accede a la cuenta de cPanel<\/strong> del dominio.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/acceso-cpanel.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"342\" height=\"401\" src=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/acceso-cpanel.jpg\" alt=\"\" class=\"wp-image-9205\" srcset=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/acceso-cpanel.jpg 342w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/acceso-cpanel-256x300.jpg 256w\" sizes=\"auto, (max-width: 342px) 100vw, 342px\" \/><\/a><figcaption>Acceso cPanel<\/figcaption><\/figure><\/div>\n\n\n\n<p>En la pantalla principal del panel haz clic en el enlace <strong>Administrador de archivos<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/herramientas-archivos.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"556\" height=\"312\" src=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/herramientas-archivos.jpg\" alt=\"\" class=\"wp-image-9206\" srcset=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/herramientas-archivos.jpg 556w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/herramientas-archivos-300x168.jpg 300w\" sizes=\"auto, (max-width: 556px) 100vw, 556px\" \/><\/a><figcaption>Herramientas archivos<\/figcaption><\/figure><\/div>\n\n\n\n<p>En el listado de archivos haz <strong>doble clic en la carpeta public_html<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/listado-archivos.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"460\" height=\"851\" src=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/listado-archivos.jpg\" alt=\"\" class=\"wp-image-9207\" srcset=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/listado-archivos.jpg 460w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/listado-archivos-162x300.jpg 162w\" sizes=\"auto, (max-width: 460px) 100vw, 460px\" \/><\/a><figcaption>Listado de archivos<\/figcaption><\/figure><\/div>\n\n\n\n<p>Haz <strong>clic en el fichero .htaccess<\/strong> y pulsa en el bot\u00f3n <strong>Editar<\/strong> situado en la barra superior.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/listado-archivos-public-html.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"824\" height=\"368\" src=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/listado-archivos-public-html.jpg\" alt=\"\" class=\"wp-image-9208\" srcset=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/listado-archivos-public-html.jpg 824w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/listado-archivos-public-html-300x134.jpg 300w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/listado-archivos-public-html-768x343.jpg 768w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/listado-archivos-public-html-600x268.jpg 600w\" sizes=\"auto, (max-width: 824px) 100vw, 824px\" \/><\/a><figcaption>Listado de archivos public_html<\/figcaption><\/figure><\/div>\n\n\n\n<p>En la pantalla emergente <strong>pulsa el bot\u00f3n Edit<\/strong> para entrar en la opci\u00f3n de editar el fichero.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/editar-htaccess.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"534\" height=\"371\" src=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/editar-htaccess.jpg\" alt=\"\" class=\"wp-image-9209\" srcset=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/editar-htaccess.jpg 534w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/editar-htaccess-300x208.jpg 300w\" sizes=\"auto, (max-width: 534px) 100vw, 534px\" \/><\/a><figcaption>Confirmar edici\u00f3n de htaccess<\/figcaption><\/figure><\/div>\n\n\n\n<p><strong>Pega al final del .htaccess el contenido<\/strong> generado anteriormente con las IPs de los pa\u00edses y pulsa el bot\u00f3n <strong>Guardar cambios<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/guardar-cambios-htaccess.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"625\" height=\"872\" src=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/guardar-cambios-htaccess.jpg\" alt=\"\" class=\"wp-image-9210\" srcset=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/guardar-cambios-htaccess.jpg 625w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/guardar-cambios-htaccess-215x300.jpg 215w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/guardar-cambios-htaccess-600x837.jpg 600w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/a><figcaption>Contenido .htaccess<\/figcaption><\/figure><\/div>\n\n\n\n<p>Ya estar\u00e1 <strong>guardado el contenido del .htaccess<\/strong> con las IPs de los pa\u00edses que no quieres que visiten tu dominio.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/cambios-htaccess-guardados.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"380\" height=\"102\" src=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/cambios-htaccess-guardados.jpg\" alt=\"\" class=\"wp-image-9211\" srcset=\"https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/cambios-htaccess-guardados.jpg 380w, https:\/\/hosting.airetech.es\/blog\/wp-content\/uploads\/2020\/02\/cambios-htaccess-guardados-300x81.jpg 300w\" sizes=\"auto, (max-width: 380px) 100vw, 380px\" \/><\/a><figcaption>Archivo modificado<\/figcaption><\/figure><\/div>\n\n\n\n<p>Esperamos que esta entrada te sea de utilidad.<\/p>\n","protected":false},"excerpt":{"rendered":"Si quieres que tus dominios no tengan visitas de alg\u00fan pa\u00eds concreto, puedes bloquearlas utilizando el fichero .htaccess. Esto puede resultar muy \u00fatil para evitar robots o crawlers de algunos pa\u00edses que lo \u00fanico que hacen es sobrecargar tu sitio web. Si no tienes p\u00fablico objetivo en esos pa\u00edses, lo mejor es bloquear el acceso desde ellos. Para hacerlo lo&nbsp;<a href=\"https:\/\/hosting.airetech.es\/blog\/wiki\/cortar-ips-de-determinados-paises-usando-htaccess\/\" class=\"read-more\">Seguir leyendo<\/a>","protected":false},"author":1,"featured_media":9210,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[495,13,7,8,6],"tags":[563,564,565,562,273],"class_list":["post-9200","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dominios-hosting","category-hosting","category-servidores-dedicados","category-servidores-virtuales-vps","category-wiki","tag-bloquear-acceso-paises","tag-bloquear-paises","tag-bloqueo-pais","tag-cortar-ips-de-paises","tag-htaccess","cat-495-id","cat-13-id","cat-7-id","cat-8-id","cat-6-id"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts\/9200","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/comments?post=9200"}],"version-history":[{"count":1,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts\/9200\/revisions"}],"predecessor-version":[{"id":9212,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/posts\/9200\/revisions\/9212"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/media\/9210"}],"wp:attachment":[{"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/media?parent=9200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/categories?post=9200"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hosting.airetech.es\/blog\/wp-json\/wp\/v2\/tags?post=9200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}