Question about img src=

Discussion in 'HTML & Website Design' started by rdv817, Apr 14, 2007.

  1. #1
    I hope this is the right place to ask this...

    I have a website that I use to create url's for images so that I can put the images onto other sites of mine.

    This allows me to create the img src="my URL" that I need.

    The question/problem that I have is that other webmasters are doing image searches, finding my images, and using my URL's to put those images on their sites. Ultimately they are using my bandwidth for the images.

    I don't care that they are using the images, since the images come from creative commons sites, but I do care that they are using my URL's and bandwidth for this.

    How do I go about creating the img src code and prevent people from doing this??
     
    rdv817, Apr 14, 2007 IP
  2. bacanze

    bacanze Peon

    Messages:
    2,419
    Likes Received:
    127
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Insert this within your .htaccess file

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

    If someone does hotlink to you, you can have an alternative image appear, which would be fun, also put this into your .htaccess file, however this is not neccessary.

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]
    RewriteRule \.(gif|jpg)$ http://www.mydomain.com/angryman.gif [R,L]
     
    bacanze, Apr 14, 2007 IP
  3. rdv817

    rdv817 Peon

    Messages:
    237
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for the feedback, I will give that a try.
     
    rdv817, Apr 14, 2007 IP
  4. longhornfreak

    longhornfreak Well-Known Member

    Messages:
    2,067
    Likes Received:
    95
    Best Answers:
    0
    Trophy Points:
    140
    #4
    them using your images gives you a free backlink but if it is enough bandwidth block it with the .hta access... if not just let it cause the backlink helps
     
    longhornfreak, Apr 14, 2007 IP
  5. t2000q

    t2000q Prominent Member

    Messages:
    4,636
    Likes Received:
    192
    Best Answers:
    0
    Trophy Points:
    300
    Digital Goods:
    1
    #5

    interesting stuff, I think I will try this coding as well
     
    t2000q, Apr 14, 2007 IP