How to stop hot linking

#1
I am running 2 CPU license of Litespeed with LASPI (not running suEXEC) with vbulletin forum.

I want to stop people from hot linking our attachments, since due to vb using php to serve those attachments; it wastes a lot of our resources.

I am not quite sure how to go about it, since CPanel Hot Lijnk protection doesn't seems to work with Litespeed, though I didn't try it with Apache either, so not sure if it works with it either.
 
Last edited:

NiteWave

Administrator
#4
I'm not familiar with CPanel Hot Link protection yet. but it can be easily to do in .htaccess. here's an example:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} \.(gif|jpe?g?|png|swf|flv|mp4|mp3)$
[NC]
RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?mydomain.com [NC]
RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?google\. [NC]
RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?yahoo\. [NC]
RewriteCond %{HTTP_REFERER} !^https?://([^.]+\.)?bing\. [NC]
RewriteRule \.(gif|jpe?g?|png|swf|flv|mp4|mp3)$ - [F,L]
 
#7
It can be downloaded.

Real problem are the image attachments, which are uploaded on our forum and then reposted elsewhere. While its not a major annoyance, it causes extra resource and bandwidth usage, which I would like to avoid, without disabling attachments for guests.
 
#9
Had been scouring through vb and vb.org, looks like there is no easy solution for stopping vb attachments to be embedded elsewhere, due to the fact that it is dynamic URL.
 
Top