{"id":14,"date":"2013-11-02T01:25:02","date_gmt":"2013-11-02T01:34:26","guid":{"rendered":"https:\/\/977a4htaccess.jpg"},"modified":"2015-07-16T18:11:33","modified_gmt":"2015-07-17T00:11:33","slug":"evitar-hotlink-mediante-htaccess","status":"publish","type":"post","link":"https:\/\/emanuelpaxtian.com\/blog\/evitar-hotlink-mediante-htaccess\/","title":{"rendered":"Evitar Hotlink mediante htaccess"},"content":{"rendered":"<p>\u00bfQu\u00e9 es Htaccess?<\/p>\n<p>Es un archivo de configuraci\u00f3n en un servidor Web, y contiene comandos en el lenguaje del servidor que le indican c\u00f3mo debe comportarse en ciertas situaciones<\/p>\n<p>&nbsp;<\/p>\n<p>El <strong>hotlinking<\/strong> es quiz\u00e1s una de las pr\u00e1cticas m\u00e1s utilizadas, todos sabemos que \u201ccompartir es bueno\u201c, que \u201chay que enlazar\u201d y todas esas cosas hasta ah\u00ed de acuerdo.<\/p>\n<p>El problema viene con las im\u00e1genes. Cuando alguien usa una imagen tuya para ilustrar una publicaci\u00f3n y si en vez de alojar la imagen en su servidor hace \u201chotlinking\u201c, o sea, \u201cA\u00f1adir \u2026 desde una URL\u201c, algo que incluso tiene su pantalla al efecto en el cargador de im\u00e1genes, est\u00e1 aumentando la carga de tu servidor sin saberlo.<\/p>\n<p>Sin mas preambulo como evitar esto<\/p>\n<p>Estas lineas de c\u00f3digo dicen que ning\u00fan fichero del tipo gif, jpg, jpeg, png o bmp puedan visualizarse desde cualquier otro sitio.<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"brush: plain\">RewriteCond %{HTTP_REFERER} !^$\r\nRewriteCond %{HTTP_REFERER} !^http:\/\/tusitio.com$ [NC]\r\nRewriteCond %{HTTP_REFERER} !^http:\/\/tusitio.com\/.*$ [NC]\r\nRewriteCond %{HTTP_REFERER} !^http:\/\/www.tusitio.com$ [NC]\r\nRewriteCond %{HTTP_REFERER} !^http:\/\/www.tusitio.com\/.*$ [NC]\r\nRewriteCond %{HTTP_REFERER} !^http:\/\/www.google.com\/reader\/view\/.*$ [NC]\r\nRewriteCond %{HTTP_REFERER} !^http:\/\/www.google.com\/reader\/m\/view\/.*$ [NC]\r\nRewriteRule .*\\.(gif|jpg|jpeg|png|bmp)$ - [F,NC,L]\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u00bfQu\u00e9 es Htaccess? Es un archivo de configuraci\u00f3n en un servidor Web, y contiene comandos en el lenguaje del servidor que le indican c\u00f3mo debe comportarse en ciertas situaciones &nbsp;&hellip;<\/p>\n","protected":false},"author":1,"featured_media":508,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-14","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-seguridad"],"_links":{"self":[{"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/posts\/14","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/comments?post=14"}],"version-history":[{"count":0,"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/posts\/14\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/media\/508"}],"wp:attachment":[{"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/media?parent=14"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/categories?post=14"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/emanuelpaxtian.com\/blog\/wp-json\/wp\/v2\/tags?post=14"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}