Hello, I have serious problem , some Chinese forums hotlinking images from my site and I even delete those images they keep sending me huge amount of http requests to my hosting server and eating up to 800mb of memory and it goes sometime to 1GB cause server crash am tired I have tried to block incoming referrer traffic from those sites using htaccess but it didn't work , I still see their http request on my server logs and memory keep goes high and I get crash every hour please tell me how can I block these http request from these domains , what is the right htaccess code , I use DirectAdmin panel by the way here example of Chinese forums that send this http requests http://75.125.41.20/viewthread.php d.mimii.info thanks
Have you tried manually creating/editing the .htaccess file? RewriteEngine On RewriteCond %{HTTP_REFERER} !^http://(.+\.)?yoursite\.com/ [NC] RewriteCond %{HTTP_REFERER} !^$ RewriteRule .*\.(jpe?g|gif|bmp|png)$ - [F] Code (markup): This checks to see if the request in coming from yoursite.com, and if so, allows the images to be displayed. If it does not, then the browser recieves a 403 Forbidden Error.
thank you but I want to allow sites to hotlink images except the Chinese forums not allowed to hot link
Try this then: RewriteEngine On RewriteCond %{HTTP_REFERER} ^http://(.+\.)?domain1\.com/ [NC,OR] RewriteCond %{HTTP_REFERER} ^http://(.+\.)?domain2\.com/ [NC,OR] RewriteCond %{HTTP_REFERER} ^http://(.+\.)?domain3\.com/ [NC] RewriteRule .*\.(jpe?g|gif|bmp|png)$ - [F] Code (markup): Just replace domain(1-3) with the domain names that you do not wish to allow hotlinking. You can add more if you want, just make sure the second last line has the only [NC].