I have an image hosting site, that I want to block and/or replace the image that shows up on the site when hotlinking. How would I go about doing this using .htaccess?
The below web site will help you to generate the required rewrite rule: http://www.htaccesstools.com/hotlink-protection/ Kailash
Thank you for that, but I'm trying to just deny 1 particular site while allowing anyone else to use it. Is there a way to do that?
Not sure if it is possible. But instead of this you can block that site IP address in your htaccess file. deny from Site_IP_Address Code (markup): Kailash
Yes, cPanel has this feature added. So we do not need to write code in htaccess for cPanel server. I am not sure if other hosting control panels provide hotlinking feature so we can block it using htaccess. Kailash
Yes it is possible. Some image hosting sites will block all their images from adult sites or forums. But, am not so sure how they do it.
Lets say that the site you want to block your images from is example.com Here's the code : RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} ^http://(www\.)?example/.com/.*$ [NC] RewriteRule \.(gif|jpg|bmp|png)$ - [F] Code (markup):