I have got problem, I wish to prevent hotlinking from some subdomain in specified directory. Let us say, that we have got images at:

http://s1.domain.com/media/image1.jpg

http://s1.domain.com/media/image2.jpg

As default it's use of these locations, and customers can easily see this photos. I wish to prevent from hot connecting, however with no error message, however with redirection, therefore if user put this address into browser (http://s1.domain.com/media/image1.digital), i wish to redirect it do PHP script, as: domain.com/filename/image1.digital. I wish to allow it to be with .htaccess. So please, are you able to produce code to place into this file.

Thank you for reactions!

within the httpd.conf do this..

SetEnvIfNoCase Referer "^http://www\.yourdomain\.com/" banimages=1
SetEnvIfNoCase Referer "^http://yourdomain\.com/" banimages=1
SetEnvIfNoCase Referer "^$" banimages=1
<FilesMatch "\.(gif|png|jpe?g)$">
  Order Allow,Deny
  Allow from env=banimages=1
</FilesMatch>

or

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?yourdomain.com/.*$ [NC]
RewriteRule ^.*\.(bmp|tif|gif|jpg|jpeg|jpe|png)$ - [F] 

as well as other techniques available too..