Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

hotlink prevention

Status
Not open for further replies.

rrsub

MIS
Oct 23, 2002
536
0
0
US
I'm using this

Code:
RewriteEngine on
RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER} !^[URL unfurl="true"]http://(www\.)?mydomain\.com[/URL] [NC]
RewriteRule \.(gif|jpe?g)$ /gfx/replacement.gif [NC,L]

to advertise our hotlinkers to our site.
Is there a way to disable the Rewrite Rule for certain IP addresses or hosts?
 
Add another "and" clause for the site you want to disable this policy for. For every subsequent site use the or clause.

1) 1 specific hosts not to receive the alternate image

RewriteEngine on
RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER} !^ [NC]
RewriteCond %{REMOTE_HOST} !^10\.10\.10\.10
RewriteRule \.(gif|jpe?g)$ /gfx/replacement.gif [NC,L]

2) 1 or more specific hosts not to receive the alternate image

RewriteEngine on
RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER} !^ [NC]
RewriteCond %{REMOTE_HOST} !^10\.10\.10\.10 [OR}
RewriteCond %{REMOTE_HOST} !^12\.12\.12\.12
RewriteRule \.(gif|jpe?g)$ /gfx/replacement.gif [NC,L]

Try this and let me know.


WarpZero Technologies
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top