Replace broken images with a standard image?

Discussion in 'Programming' started by NAZAM.COM, Jun 13, 2006.

  1. #1
    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.
     
    NAZAM.COM, Jun 13, 2006 IP
  2. jnestor

    jnestor Peon

    Messages:
    133
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mysite\.com/ [NC]
    RewriteCond %{HTTP_REFERER} !^$
    RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpe [L]

    replace "/images/nohotlink.jpe" with whatever image you want to use.
     
    jnestor, Jun 14, 2006 IP