Forum Moderators: phranque
The page where my graphic shows has this URL
[cgi.ebay.ca...]
(correct item # removed).
I have tried all of the following and none work. As I said, I already have a file running to stop a few other specific sites and that works fine.
RewriteCond %{HTTP_REFERER} ^http://(cgi\.安ww\.)?ebay\.$ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://pages.ebay\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://cgi.ebay\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(cgi\.)?ebay\.com/ [NC,OR]
Any ideas?
RewriteCond %{HTTP_REFERER}!^http://www.yourdomain.com/.*$ [NC]
And of course, if there were a handful of other 'friendly' domains allowed to access them, you could add them to the list with [OR]
Example htaccess:
Options +FollowSymLinks
RewriteEngine on
# prevent image hijacking
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http://(www\.)?mydomain\.com [NC]
RewriteCond %{HTTP_REFERER}!^http://(www\.)?anotherdomain\.com [NC]
RewriteCond %{HTTP_REFERER}!^http://(www\.)?friendlydomain\.com [NC]
RewriteCond %{REQUEST_URI}!^/images/forhotlinkers\.gif$
RewriteRule \.(jpeg?夸pg夙if如ng安mv妃ov)$ [mydomain.com...] [NC,R,L]
This displays a GIF named "forhotlinkers" from the mydomain.com's images folder if any graphics on mydomain.com are hotlinked from anywhere other than the domains listed above.
TEST before implementing on your site. I just swiped and example-ized my relevant htaccess lines.
Welcome to WebmasterWorld!
I suspect that you will find that your original code works for most cases if you flush your browser cache (temporary internet files) before testing any change to access restrictions. Otherwise, the image will be fetched from your local cache and not from your server. Therefore, the access restrictions on your server can have no effect.
I'd suggest
RewriteCond %{HTTP_REFERER} ^http://(cgi如ages安ww\.)?ebay\. [NC,OR]
Jim
If you want to get sneaky, then don't give any indication that you're catching hotlinkers. Change your final two lines to:
RewriteCond %{REQUEST_URI} !^/images/forhotlinkers\.gif$
RewriteRule \.(jpeg?夸pg夙if如ng安mv妃ov)$ [b]/images/forhotlinkers.gif [NC,L][/b]
Jim