Jump to content

Hotlink protection enabled

Axel Wers

Recommended Posts

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

Link to comment
Share on other sites


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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...