Forum Moderators: phranque
I never thought i would be back so soon but this time its not about my site but a friend from the u.k
he discovered someone was hotlinking an animated under construction image and he was realy pissed so i said well thats easy solved .
So confident as i was i put in the codes i used some time ago.
guess what..it didnt worked.
I tried another one and another and even this one below i grabbed from the forum here..
RewriteEngine on
RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http://website.co.uk/.*$ [NC]
RewriteCond %{HTTP_REFERER}!^http://www.website.co.uk/.*$ [NC]
RewriteRule .*\.(gif¦GIF¦jpg¦JPG)$ [website.co.uk...] [R]
And even this doesnt work!
It turns his site into 500 server error.
Believe it or not but ive tried about 8 versions and one of them actualy prevented the hotlinking but i couldnt get the theft image to show,thats why i continued searching.
The only thing in the htaccess is:
#DirectoryIndex index.html index.php
php_flag output_buffering on
php_flag magic_quotes_gpc ON
The DirectoryIndex line is temporary taken out as you see "#" cause it gave errors...
Anyone have clue whats going on?
Is the u.k that different?
(You could not pay me enough to host on a server with no log file access...)
The code you've posted appears to be auto-generated -- It is inefficient and contains unnecessary regex tokens. So I'll take *one* shot in the dark, and suggest:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER} !^http://(www\.)?website\.co\.uk
RewriteCond %{REQUEST_URI} !/images/theft\.jpg$
RewriteRule \.(gif¦jpg)$ http://www.website.co.uk/images/theft.jpg [NC,R=302,L]
For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].
Jim
The htaccess looks like this:
DirectoryIndex index.html index.php
php_flag output_buffering on
php_flag magic_quotes_gpc ON
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER}!^http://(www\.)?website\.co\.uk
RewriteCond %{REQUEST_URI}!/images/theft\.jpg$
RewriteRule \.(gif¦jpg)$ [website.co.uk...] [NC,R=302,L]
but nothing happens and hotlinking is allowed...
RewriteCond %{REQUEST_URI} !/images/theft\.jpg$
RewriteRule \.(gif¦jpg)$ http://www.website.co.uk/images/theft.jpg [NC,R=302,L]
If that works, then add the other two RewriteConds one at a time, flushing your browser cache each time, and see where you have a problem. Assuming you're using IE, flush using Control Panel -> Internet Options -> Temporary Internet Files -> Delete Files, and do select the Delete all offline content option.
Jim
[edit] Fixed space between "}" and "!" [/edit]
[edited by: jdMorgan at 2:23 pm (utc) on Feb. 13, 2006]