Axel Wers Posted July 28, 2009 Posted July 28, 2009 This feauture could be applied on smilies directory as well not only uploads directory. I found unknown chat room where they has stolen my smilies, smilies were linked from my board, but I copied .htaccess file from my uploads directory to directory where I have smilies and now they have big No Permissions image instead of smilies :P :P :P
bfarber Posted July 28, 2009 Posted July 28, 2009 hotlink protection really isn't an IPB feature. It's Apache functionality that anyone can setup (static html pages, or web applications, doesn't matter).
Mark H. Posted July 28, 2009 Posted July 28, 2009 Axel, In the .htaccess file in your forum root (or you can put it the .htaccess file that's in your public_html folder, to make it site-wide), add the following lines *after* the "DirectoryIndex" line : RewriteCond %{HTTP_REFERER} !^http://mydomain.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://mydomain.com$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com$ [NC] RewriteRule .*\.(jpg|jpeg|gif|png|bmp|avi|mov|wma|wmf|wmv|doc|pps|xls)$ /leecher.html [R,NC] Substitute "mydomain.com" with your own domain name, but leave the remainder of each line as shown. I created a page titled "leecher.html" and placed in public_html, so that's why the last line references it. You can use any page name you wish, as long as it's in the public_html directory for that Domain of yours, then change "leecher.html" to the name you've used. It's one easy option, anyway, and prevents hotlinking of all the filetypes listed in the last line. You can add filetypes as you see fit, but follow the example as shown.
Axel Wers Posted July 28, 2009 Author Posted July 28, 2009 Hm I don't know what is wrong, but it works only when I want to protect files in uploads directory I have to put htaccess there (to uploads directory). If I put that htaccess file to root directory it doesn't work. OK please move this topic somewhere other.
Mark H. Posted July 28, 2009 Posted July 28, 2009 Well, the presence of an .htaccess in a directory "below" public_html will override the one in public_html. But if you add the above to your upload directory's .htaccess and it works, then problem solved!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.