Forum Moderators: phranque

Message Too Old, No Replies

Hotlink blocking problem

Replacing pictures on my site as well

         

Mad_Max

9:34 pm on Mar 6, 2003 (gmt 0)

10+ Year Member



I can't figure out what I'm missing, it's probably somehting really small :\

Any help would be greatly appreciated, thanks.

____________________________________
RewriteEngine On

RewriteCond %{HTTP_REFERER}!^$
RewriteCond %{HTTP_REFERER}!^http://(www\.)?domain\.com/ [NC]
RewriteCond %{HTTP_REFERER}!^http://216\.239\.(3[2-9]¦[45][0-9]¦6[0-3]).*(www\.)?domain\.com [NC]
RewriteCond %{HTTP_REFERER}!^http://babel.altavista.com/.*(www\.)?domain\.com [NC]
RewriteCond %{HTTP_REFERER}!^http://216\.243\.113\.1/cgi/
RewriteCond %{HTTP_REFERER}!^http://search.*\.cometsystems\.com/search.*(www\.)?domain\.com [NC]
RewriteCond %{HTTP_REFERER}!^http://.*searchhippo\.com.*(www\.)?domain\.com [NC]
RewriteCond %{REQUEST_URI}!link\.jpg$ [NC]
RewriteRule \.(gif¦jpe?g)$ [domain.com...] [NC,R,L]

RewriteRule ^Car-News-([1-9][0-9]*).* modules.php?op=modload&name=News&file=article&sid=$1
RewriteRule ^Car-Review-([1-9][0-9]*).* modules.php?op=modload&name=Reviews&file=index&req=showcontent&id=$1
RewriteRule ^Car-Links-([1-9][0-9]*).* modules.php?op=modload&name=Web_Links&file=index&req=viewlink&cid=$1
RewriteRule ^Visit-Site-([1-9][0-9]*).* modules.php?op=modload&name=Web_Links&file=index&req=visit&lid=$1
RewriteRule ^Car-News-Archive.html modules.php?op=modload&name=Search&file=index&action=search&overview=1&active_stories=1

[edited by: Mad_Max at 10:04 pm (utc) on Mar. 6, 2003]

jdMorgan

9:47 pm on Mar 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What is the question?

Jim

Mad_Max

10:02 pm on Mar 6, 2003 (gmt 0)

10+ Year Member



Oops, sorry, got ahead of myself.

It's replacing the pictures on my site with the one that is supposed to only be used for external hotlinking.

jdMorgan

10:05 pm on Mar 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Mad_Max,

The second RewriteCond line must match your domain name, with and without "www.", i.e.

RewriteCond %{HTTP_REFERER} !^http://(www\.)?fuzzy-blue-widgets\.com/ [NC]

That's the only one that could "fool" the code.

The target address in the RewriteRule need not and should not contain "http://" and [R], unless you are redirecting to a different server. If you don't use [R], then you don't need the last RewriteCond - the one for REQUEST_URI.


RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^http://216\.239\.(3[2-9]¦[45][0-9]¦6[0-3]).*(www\.)?carbc\.com [NC]
RewriteCond %{HTTP_REFERER} !^http://babel.altavista.com/.*(www\.)?carbc\.com [NC]
RewriteCond %{HTTP_REFERER} !^http://216\.243\.113\.1/cgi/
RewriteCond %{HTTP_REFERER} !^http://search.*\.cometsystems\.com/search.*(www\.)?carbc\.com [NC]
RewriteCond %{HTTP_REFERER} !^http://.*searchhippo\.com.*(www\.)?carbc\.com [NC]
# RewriteCond %{REQUEST_URI} !link\.jpg$ [NC]
RewriteRule \.(gif¦jpe?g)$ /link.jpg [NC,L]

And to reiterate the standard warning, "¦" characters must be edited to appear as a solid vertical line, and "!" characters used in patterns must have a preceding space.

HTH,
Jim

Mad_Max

11:27 pm on Mar 6, 2003 (gmt 0)

10+ Year Member



I basically copy and pasted what you posted (I did change the ¦ problem), but it didn't seem to work. The pictures were loading fine on my site, but hotlink blocking was no longer working.

I didn't get a chance to test it too much though, apparently somebody has taken time out of their busy day to bring my hosting server to it's knees :(