Forum Moderators: phranque

Message Too Old, No Replies

Replace broken images with a standard image?

Want to present hotlinkers with an image of my choosing

         

1Lit

7:34 pm on Jun 13, 2006 (gmt 0)

10+ Year Member



Because of massive bandwith sucking hotlinking from myspace users, I have renamed all the images on my site. Is there any script or ammendment to .htaccess so that if somebody refers to any broken image on my site they see an image of my choice?

Thank you.

jdMorgan

5:34 pm on Jun 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Add something like this to the existing rules in your .htaccess file:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \.(gif¦jpe?g¦png)$ http://www.example.com/path_to_replacement_image.gif [R=301,L]

Replace all broken pipe "¦" characters in the code above with solid pipes before use; Posting here modifies those characters.

Jim