Forum Moderators: phranque
The blog is on blogspot.com
Not only is the blogger in question hotlinking like crazy (20,000 requests so far this month), but is copying opening paragraphs verbatim and then linking to the full content.
I looked at Blogspot's DMCA requitrements and they are a bit difficult to understand. Quite convenient .. for blogspot.
For Best Information on "Destination"visit MyReallyGreatSite.com
Is showing in 7 places on his blog.
I wondered why the hyperlink was also opening the hotlink.gif image .. now I know,
Thanks Zydo and Jim
Forgot to add .. the links to my content pages ala
http://www.example.com/mypage.php
apparently creates a loop (according to FF) .. so I'm wondering if that puts extra load on the server.
Right now the lines are commented out.
[edited by: jdMorgan at 4:10 pm (utc) on May 22, 2008]
[edit reason] example.com [/edit]
Most likely because the code does not prevent a request for the replacement page/image from also being rewritten or redirected. This must be done explicitly in the code. Since I don't know what your code looks like, I can't be more specific.
Yes, that puts a big load on the server, the client, and the internet connection, and really should be fixed.
Jim
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?myspace\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?blogspot\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://(.+\.)?livejournal\.com/ [NC]
RewriteRule .*\.(jpe?g¦gif¦bmp¦png)$ hotlink.gif [L]
#RewriteCond %{HTTP_REFERER} [hotlinker.blogspot.com...]
#RewriteRule (.*) [mysite.com...]
As you can see, the lines causing the loop are commented out
RewriteEngine on
#
[b]RewriteCond %{REQUEST_URI} !^/hotlink\.gif$[/b]
RewriteCond %{HTTP_REFERER} ^http://([^.]+\.)*myspace\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://([^.]+\.)*blogspot\.com/ [NC,OR]
RewriteCond %{HTTP_REFERER} ^http://([^.]+\.)*livejournal\.com/ [NC]
RewriteRule \.(jpe?g¦gif¦bmp¦png)$ hotlink.gif [L]
For later readers: Replace the broken pipe "¦" characters above with solid pipe characters before use; Posting on this forum modifies the pipe characters.
Jim
This line *apparently* causes a problem
RewriteCond %{REQUEST_URI} !^/hotlink\.gif$
The blogger is using 2 types of hyperlinks
1 - "Larger version of Image" >> [mysite.com...]
The blogger has also copied opening paragraphs from some of my content pages verbatim and then linked to the full content page on my site.
2 - "More information" >> [mysite.com...]
When a link is clicked for #2, the hotlink.gif image shows on my own "my-content-page.php" instead of the original images
Then, if you visit your own site, your page tries to load up the "good" image, but your browser renders the anti-hotlink image that it has just cached under that good-image's URL.
Bottom line is that when testing this kind of thing, you need to completely-flush your browser cache before loading any different Web page.
This can be overcome by using an external redirect instead of a internal rewrite, but this then "gives away" the fact that you've got an anti-hotlinking routine active on your site. Since no anti-hotlinking can be 100% effective, it's best to leave the hotlinker-webmaster (or forum/blog poster) scratching his head and wondering why his hotlinks fail most of the time -- Maybe he'll quit doing it.
Jim
But in the mean time I did do this
"Of course, the replacement image could have your URL in it if you like... to be typed in by the viewer."
<snip>
Then find I have wasted a lot of time
"No, you can deny the request, or rewrite or redirect it to another image. <img src="xyz"> tags will not load another HTML page, they only work with images."
But in my ignorance of coding im not fully convinced it cant be done?....
what if .htaccess had something like this
"
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} .*jpg$.*gif$.*png$ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !example\.net [NC]
RewriteCond %{HTTP_REFERER} !example\.sytes\.net [NC]
RewriteCond %{HTTP_REFERER} !google\. [NC]
RewriteCond %{HTTP_REFERER} !search\?q=cache [NC]
RewriteRule (.*) /banhotlink.php?pic=$1
Then Something in the banhotlink.php to make it work..(this doesnt but along these lines? I have read where
<?php
header("Content-type: text/html");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-store, no-cache,
must-revalidate");
header("Cache-Control: post-check=0, pre-check=0",
false);
header("Pragma: no-cache");
// $pic = strip_tags( $_GET['pic'] );
// if ( ! $pic ) {
// die("No picture specified.");
// }
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title><?php echo($pic); ?></title>
<meta
http-equiv="Content-Type"
content="text/html; charset=iso-8859-1"
>
</head>
<body>
<p>
<a href="http://www.example.net"><strong><big></big></strong><b>Due to Hotlinking Abuse the Practice is Blocked</b><br>
<img src=/kikelogosm.gif width=315 height=61><br>
<strong><big></big></strong><b>You May Like to click Our Banner to Visit Us</b></a><br>
Admin: example.net
</p>
</body>
</html>
OR is it just impossible to put a url linked pic inside [img] [/img] tags on a website?
[edited by: jdMorgan at 4:15 pm (utc) on June 11, 2008]
[edit reason] No URLs, please. See Terms of Service and Charter [/edit]
Your mod_rewrite code looks like it was auto-generated for the most part, and could do with some clean-up and error corrections:
RewriteEngine on
RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER} !example\.(sytes\.)?net [NC]
RewriteCond %{HTTP_REFERER} !\.google\. [NC]
RewriteCond %{HTTP_REFERER} !search\?q=cache [NC]
RewriteRule ^(.+\.(jpg¦gif¦png))$ /banhotlink.php?pic=$1 [NC,L]
Replace the broken pipe "¦" characters in the RewriteRule pattern with solid pipe characters before use; Posting on this forum modifies the pipe characters.
Jim
SetEnvIf Referer ^http:// realref=1
SetEnvIf Referer ^http://(www\.)?domain.com goodref=1
SetEnvIf Referer ^http://(www\.)?other-domain.net goodref=1
<FilesMatch "\.(gif¦jpe?g¦png)$">
Order Deny,Allow
Deny from env=realref
Allow from env=goodref
</Files>
Using mod_rewrite is much slower way, while it allow to redirect this traffic (by mod_setenvif you can only block hotlink)
If your hotlinked data is in separate directory only - you can place this .htaccess there and skip <FilesMatch> and </FilesMatch> - it will be something faster.
If you don't want to pass empty referer then replace 'Order Deny,Allow' by 'Order Allow,Deny'