All .htacces and mod_rewrite answered - examples, tips and tricks Forum Index  

All .htacces and mod_rewrite answered - examples, tips and tricks Forum Index -> Referrers -> Hot linking (stealing images)
Author Message
admin
Site Admin


Joined: 18 Jul 2006
Posts: 89

PostPosted: Tue Jul 18, 2006 7:15 am    

Hot linking (stealing images)

Reply with quote

Code:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?YourSite\.com/.*$ [NC]
RewriteRule \.(gif|jpg)$ - [F]


Replace "YourSite.com" with your own. The above code causes a broken image to be displayed when it's hot linked. If you'd like to display an alternate image in place of the hot linked one, replace the last line with...

Code:
RewriteRule \.(gif|jpg)$ http://www.YourSite.com/stop.gif [R,L]


Replace "YourSite.com" and stop.gif with your real names.

Source: http://www.buildwebsite4u.com/advanced/htaccess-file.shtml
Back to top
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.   
View previous topic
View next topic
All .htacces and mod_rewrite answered - examples, tips and tricks Forum Index
Page 1 of 1
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
FreeMind 1.1 Template by AU Templates