Hi,
I came across this bit of code to prevent hotlinking of my images on
https://secure.myultratrust.com and
http://myultratrust.com
I put the following in my httpd.conf file:
SetEnvIfNoCase Referer "^https://secure\.myultratrust\.com/" banimages=1
SetEnvIfNoCase Referer "^http://myultratrust\.com/" banimages=1
SetEnvIfNoCase Referer "^http://www\.myultratrust\.com/" banimages=1
SetEnvIfNoCase Referer "^$" banimages=1
<FilesMatch "\.(gif|png|jpe?g)$">
Order Allow,Deny
Allow from env=banimages=1
</FilesMatch>
Open in new window
I then restarted apache. But the above prevents my images from displaying on my own site though.
Also, I tried this in my .htaccess file:
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?cyberciti.biz/.*$ [NC]
RewriteRule ^.*\.(bmp|tif|gif|jpg|jpeg|jpe|png)$ - [F]
Open in new window
I restarted apache. But I still see the image here:
http://tutorialref.com/test/temp/test_hotlinking.html
https://secure.myultratrust.com/diy/login/images/bottom-separator.png - that's an image to test.
Thank you,
Victor
http://www.javascriptkit.com/howto/htaccess10.shtml
Here are some suggestions from Dreamhost:
http://wiki.dreamhost.com/Preventing_hotlinking