Forum Moderators: phranque
For some of the worst offenders I have looked up their IP addresses and done an IP deny in CPanel, but when I check the page, the images still show.
So I'm wondering if they are running through another IP or?
I would actually like to do a hotlinks deny/allow, but with so many search engine datacenters I don't want to block my images from a page cache on the search engines.
Any suggestions?
RewriteEngine on
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http(s)?://(www\.)?example.com.*$ [NC]
RewriteCond %{HTTP_REFERER}!^http(s)?://(www\.)?example2.com.*$ [NC]
RewriteRule ^.+\.(jpg¦jpeg¦png¦gif)$ http://www.example.com/myad.jpg [NC,R,L]
(note this is untested so test it if you use it and make sure to fix the pipe characters!)
This only allows hotlinking from example.com (your site), example2.com (another one of your sites you want to hotlink from), etc. This is better than denying hot linking by ip really because it blocks everyone besides the domains you want to allow.
First, thanks very much.
"RewriteEngine on
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http(s)?://(www\.)?example.com.*$ [NC]
RewriteCond %{HTTP_REFERER}!^http(s)?://(www\.)?example2.com.*$ [NC]
RewriteRule ^.+\.(jpg¦jpeg¦png¦gif)$ http://www.example.com/myad.jpg [NC,R,L]"
How could I cover all iterations of Google, Yahoo, MSN, etc?
If I use?google.com would that cover all data centers? Or would I need to use?*.google.com? How about international sites?*.google.*? Or do I have to do them individually like?google.co.uk
I notice that MSN is search.msn.com .. same approach?
Sorry for the dumb questions.:>\
RewriteEngine on
RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER} !^https?://(www\.)?example\.com [NC]
RewriteCond %{HTTP_REFERER} !^https?://(www\.)?example2\.com [NC]
RewriteCond %{HTTP_REFERER} !^https?://([^\?]+)?search\.[^/]+ [NC]
RewriteRule \.(jpe?g¦png¦gif)$ /myad.jpg [NC,L]
Change the broken pipe "¦" characters above to solid pipes from your keyboard before use; Posting on this board modifies them.
Flush your browser cache before testing any change to access-control code.
Jim