Hi with help on this site we came up with this for me to use to help stop the hotlinking, i am working on the more involved way that Fou Lu suggested but for now this will have to do.

I dont understand why this is blocking all the images on my site home page. Its suppose to just block if someone hotlinks an image or if they try to bring up an image from the site in a url on a browser.


But for some reason when i post this, all the images on my site index dissappear with the dreaded x lol.

This setup worked perfect in my other cPanel because that site is actually an addon domain so the htaccess is not the root htaccess.

But on this site the htaccess is actually the root htaccess so as you can see i had to also add my add on domain to the approval list as well, (which works fine) but i dont understand why the root domain images are getting blocked (the mysitename.com)

PHP Code:

#block images by direct url all sites listed are authorized
RewriteEngine on
RewriteCond 
%{HTTP_REFERER} !^http://(www.)?mysitename.com/      [NC]
#RewriteCond %{HTTP_REFERER} !^http://(www.)?addondomain_sitename.com/      [NC]

#add another site here if you want - all listed are approved
#RewriteCond %{HTTP_REFERER} !^http://(www.)?site2.com/      [NC]
#RewriteCond %{HTTP_REFERER} !^http://(www.)?site3.com/      [NC]

#browsers send blank referrer so block url in browser too
#optional but recommended - allow blank referrer
#RewriteCond %{HTTP_REFERER} !^$

RewriteRule .*.(jpg|jpeg|gif|png|bmp|wmv)$ - [F,NC,L]
#end block