
{"id":1138,"date":"2008-05-09T19:38:33","date_gmt":"2008-05-10T02:38:33","guid":{"rendered":"http:\/\/montaraventures.com\/blog\/?p=1138"},"modified":"2008-05-09T20:06:48","modified_gmt":"2008-05-10T03:06:48","slug":"hotlinking-redux","status":"publish","type":"post","link":"https:\/\/montaraventures.com\/blog\/2008\/05\/09\/hotlinking-redux\/","title":{"rendered":"Hotlinking Redux"},"content":{"rendered":"<div style=\"float: right; margin: 10px;\"><img decoding=\"async\" src=\"https:\/\/montaraventures.com\/blog\/wp-content\/2008\/05\/hotlink1.jpg\" alt=\"Do not hotlink\" width=325 height=258 \/><\/div>\n<p>Well, <a href=\"https:\/\/montaraventures.com\/blog\/2007\/12\/21\/guide-to-link-etiquette\/\" target=\"_blank\" >I&#8217;ve tried being nice, I&#8217;ve tried being reasonable<\/a>, I&#8217;ve tried everything I can think of to stop people from <a href=\"https:\/\/montaraventures.com\/blog\/2007\/12\/21\/guide-to-link-etiquette\/\" target=\"_blank\" >hotlinking<\/a> to images on this site. It&#8217;s all to no avail, so I&#8217;ve implemented an extremely rude picture that chastises the <a href=\"https:\/\/montaraventures.com\/blog\/2007\/12\/21\/guide-to-link-etiquette\/\" target=\"_blank\" >hotlinker<\/a> and is rude enough that hotlinking will likely reduce to nothing. It&#8217;s a shame that it had to come to this, but I don&#8217;t know what else to do.<br \/>\n<br \/>\nIn case you want to prevent hotlinking, here&#8217;s how. Create a .htaccess file in your images directory on your webserver. Ensure that mod_rewrite is functional on your webserver. Then put the following contents in your .htaccess file:<\/p>\n<blockquote><p>\nRewriteEngine on<br \/>\nRewriteCond %{HTTP_REFERER} !^$<br \/>\nRewriteCond %{HTTP_REFERER} !^https:\/\/(www\\.)?YOURDOMAIN.com\/.*$ [NC]<br \/>\nRewriteRule \\.(gif|jpg)$ https:\/\/YOURDOMAIN.com\/SUBSTITUTEIMAGE.jpg [R,L]\n<\/p><\/blockquote>\n<p>\nThe trick here is to make sure that the substitute file you&#8217;ll serve is not in the same directory you&#8217;re preventing access to and that you replace YOURDOMAIN with whatever your website is and replace SUBSTITUTEIMAGE with what you deem to be an appropriate message to share with the offender. Good luck.<br \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Well, I&#8217;ve tried being nice, I&#8217;ve tried being reasonable, I&#8217;ve tried everything I can think of to stop people from hotlinking to images on this site. It&#8217;s all to no avail, so I&#8217;ve implemented an extremely rude picture that chastises the hotlinker and is rude enough that hotlinking will likely reduce to nothing. It&#8217;s a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"_links":{"self":[{"href":"https:\/\/montaraventures.com\/blog\/wp-json\/wp\/v2\/posts\/1138"}],"collection":[{"href":"https:\/\/montaraventures.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/montaraventures.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/montaraventures.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/montaraventures.com\/blog\/wp-json\/wp\/v2\/comments?post=1138"}],"version-history":[{"count":0,"href":"https:\/\/montaraventures.com\/blog\/wp-json\/wp\/v2\/posts\/1138\/revisions"}],"wp:attachment":[{"href":"https:\/\/montaraventures.com\/blog\/wp-json\/wp\/v2\/media?parent=1138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/montaraventures.com\/blog\/wp-json\/wp\/v2\/categories?post=1138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/montaraventures.com\/blog\/wp-json\/wp\/v2\/tags?post=1138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}