|
2004-08-10, 10:10 AM | #1 |
Aw, Dad, you've done a lot of great things, but you're a very old man, and old people are useless
Join Date: May 2004
Posts: 25
|
special anty hotlink
hi
i need such antyhotlink that from other domain hotlink will impossible but from my own domain will possible? do you know how to do this? |
2004-08-10, 11:23 PM | #2 |
If something goes wrong at the plant, blame the guy who can't speak English
Join Date: Jan 2004
Location: Poland
Posts: 30
|
it's easy with htaccess
Code:
RewriteEngine on RewriteCond %{HTTP_REFERER} !^$ [NC] RewriteCond %{HTTP_REFERER} !^http(s)?://cgi.(aol\.)?ebay\.com [NC] RewriteCond %{HTTP_REFERER} !^(wy[sc]iwyg://[0-9]*/)?http(s)?://YOUR_SITE_IP [NC] RewriteCond %{HTTP_REFERER} !^(wy[sc]iwyg://[0-9]*/)?http(s)?://YOUR_SITE_DOMAIN [NC] RewriteCond %{HTTP_REFERER} !^(wy[sc]iwyg://[0-9]*/)?http(s)?://OTHER_SITE_DOMAIN [NC] RewriteRule \.(bmp|gif|jpe?g)$ - [F,L] YOUR_SITE_IP = your server ip 123.123.123.123 YOUR_SITE_DOMAIN = www.my_cool_domain.com OTHER_SITE_DOMAIN - other domain that you allow hotlink |
2004-08-11, 08:18 AM | #3 |
If something goes wrong at the plant, blame the guy who can't speak English
Join Date: Jul 2004
Posts: 30
|
All the rules are trickable as they are shown here and almost everywhere on the web. Always terminate the condition line by something like this --
Code:
(/|\?|$) Code:
RewriteCond %{HTTP_REFERER} !^(wy[sc]iwyg://[0-9]*/)?http(s)?://YOUR_SITE_IP(/|\?|$) [NC] http://www.yourdomain.com.my-evil-hotlinkingdomain.com It is not a problem to setup a vhost which will fit your regexp needs and this mistake is the worse since it is highly predictable. Another good idea should be allowing access to pictures from image searches and probably from local stored pages too. Code:
# Allow Saved Pages RewriteCond %{HTTP_REFERER} !^file://.*$ [NC] # Search Engines RewriteCond %{HTTP_REFERER} !^http://([^/]*\.)?google\.(.{2}\.)?.{2,3}/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://([^/]*\.)?yahoo\.(.){2,3}/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://216\.239\.59\.104/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://64\.233\.161\.104/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://66\.102\.7\.104/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://64\.233\.167\.104/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://216\.239\.41\.104/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://216\.239\.39\.104/.*$ [NC] Oh my god I did it! My first post here ... (edited to add the code tags) Last edited by dgraf; 2004-08-11 at 08:23 AM.. |
2004-08-11, 07:40 PM | #4 |
If something goes wrong at the plant, blame the guy who can't speak English
Join Date: Jan 2004
Location: Poland
Posts: 30
|
yeap
dgraf is right about that ("always terminate the condition line") EDITED: it can be easy tricked with vhosts when there is no termination |
|
|