Jump to content

Preventing Hotlinking From Specified Sites


Recommended Posts

The easiest way to do this is to go into cpanel and use the hotlinking option on the right I believe under site maintenance.

 

In the large box on that page type all the sites you want to allow to hotlink. All others will be un available.

 

I just recently started using this system again. It works great, but I would like to forward all unavailable hotlinks to another image. But hot linking disables it :dance:

 

Instead of a red X I would like to have an image that says hotlinking is disabled from this domain. Anyone know how this can be done? I'm sure it is .htaccess modification

 

edit: just figured an easy way to do it. I don't use png files on my site at all. So I just removed png from the extensions at the bottom and saved my file as sorry.png

 

sorry.png

 

And it works like a charm :)

Link to comment
Share on other sites

You may try one of these...

http://wsabstract.com/howto/htaccess10.shtml

http://httpd.apache.org/docs/mod/mod_rewrite.html

 

>RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http://site.that.shouldnt.be.linking.com$ [NC]
RewriteRule \.(gif|jpg)$ - [F]

 

or

 

>RewriteEngine on
RewriteCond %{HTTP_REFERER} ^http://site.that.shouldnt.be.linking.com$
RewriteRule \.(gif|jpg)$ http://www.****/nasty.gif [R,L]

 

If I'm reading the rewrite manual correctly then these should work. The second would of course forward the hotlinked image to that image. This should disable it for just that site, but I'm not positive.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...