Lonelydreamer Posted August 17, 2004 Posted August 17, 2004 I want to be able to deny access to images from only specified sites. I haven't seen any other posts like this so I thought I might as well ask. I have asked around and have been lead to belive that this can be done with some additions to the .htaccess file(s). Thanks for all your help. Quote
nafortin Posted August 17, 2004 Posted August 17, 2004 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 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 And it works like a charm Quote
Lonelydreamer Posted August 17, 2004 Author Posted August 17, 2004 The reply above doesn't exactly help me, I know about the hotlinking manager provided within cpanel, but that hasn't been the best for me, so I want to deny the certain sites that are hotlinking access instead of blocking all. Quote
nafortin Posted August 17, 2004 Posted August 17, 2004 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. Quote
natimage Posted August 17, 2004 Posted August 17, 2004 You could also consider simply banning those IP addresses that you don't want hotlinking to your site. That may be more drastic than you want, though! Quote
Lonelydreamer Posted August 17, 2004 Author Posted August 17, 2004 I tried this but even if I IP Deny a domain name it will still be able to link my images. I think that I will look into some other things Thanks for your help everyone!! Quote
nafortin Posted August 17, 2004 Posted August 17, 2004 Ip denying wouldn't have any effect because the person viewing the webpage is calling the image. The server is just essentially linking. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.