Hotlinking ?

Discussion in 'Managing Your Online Community' started by 2dub, Feb 21, 2013.

  1. 2dub

    2dub Regular Member

    Joined:
    Jun 19, 2009
    Messages:
    157
    Likes Received:
    26
    Location:
    Moyock, NC
    I was doing some reconnaissance on a competitors site and noticed they are hotlinking some images from me.

    I honestly don't care too much about the bandwidth, but I just thought I'd have some fun with it.

    Is there a way I can create some sort of hotlinking "if statement" so that if another site tries to hotlink they don't get the intended image, but would get an image that stated "The intended image comes from Umpire-Empire please visit umpire-empire.com the #1 site for your umpiring needs."

    But I would also need to have some hotlinks available as I have even instructed people how to create hotlinks for referral purposes.

    Thoughts? Ideas?
     
    Brandon likes this.
  2. Brandon

    Brandon Regular Member

    Joined:
    Jun 1, 2009
    Messages:
    6,602
    Likes Received:
    1,706
    Location:
    Topeka, Kansas
    First Name:
    Brandon
    I'm sure you can and the .htaccess file, but I don't know how off hand.
     
  3. Cerberus

    Cerberus Admin Talk Staff

    Joined:
    May 3, 2009
    Messages:
    1,031
    Likes Received:
    500
    Code:
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mysite\.com/ [NC]
    RewriteCond %{HTTP_REFERER} !^$
    RewriteRule .*\.(jpe?g|gif|bmp|png)$ http://i.imgur.com/qX4w7.gif [L]
    This would replace any image hotlinked from mysite.com with the imgur image.. Basically exactly what you want to do.. Just edit for your needs
     
    owtlawatv, Brandon and 2dub like this.
  4. 2dub

    2dub Regular Member

    Joined:
    Jun 19, 2009
    Messages:
    157
    Likes Received:
    26
    Location:
    Moyock, NC
    Awesome!

    Dumb question time... This goes in the htaccess file? Is there any specific place it should go?
    How do I identify the file where I have some images I want to allow to be hotlinked?
     
  5. Cerberus

    Cerberus Admin Talk Staff

    Joined:
    May 3, 2009
    Messages:
    1,031
    Likes Received:
    500
    This goes in your htaccess yes... And you just edit this link http://i.imgur.com/qX4w7.gif Whatever you place in its place they will see

    ai.imgur.com_qX4w7.gif
     
  6. AWS

    AWS Administrator

    Joined:
    Feb 1, 2010
    Messages:
    1,616
    Likes Received:
    692
    Location:
    Joliet, IL U.S.A.
    First Name:
    Bob
    Here is a little different method. Put it in .htaccess in the directory you serve the images from and create no_permission.png and upload it to the image dir.

    Code:
    RewriteCond %{HTTP_REFERER} !^http://(.+\.)?yourdomain\.tld/ [NC]
    RewriteCond %{HTTP_REFERER} !^$
    RewriteRule \.(gif|jpg|jpeg|png|GIF|JPG|JPEG|PNG)$ no_permission.png [L]
     
    Brandon likes this.
  7. ProSportsForums

    ProSportsForums Regular Member

    Joined:
    Dec 25, 2012
    Messages:
    529
    Likes Received:
    232
    Location:
    St Petersburg, Florida
    If that no permission image is meatspin I'll bet those bastards will stop stealing from you quickly.
     
  8. AWS

    AWS Administrator

    Joined:
    Feb 1, 2010
    Messages:
    1,616
    Likes Received:
    692
    Location:
    Joliet, IL U.S.A.
    First Name:
    Bob
    I had goatsee for a while. Now it's tame.
     
  9. Carlos

    Carlos Regular Member

    Joined:
    Apr 20, 2003
    Messages:
    751
    Likes Received:
    251
    Location:
    California
    You're an @$$hole, ain'tchoo?

    Yeah, I caught your comments at xenForo. :mad:
     
  10. AWS

    AWS Administrator

    Joined:
    Feb 1, 2010
    Messages:
    1,616
    Likes Received:
    692
    Location:
    Joliet, IL U.S.A.
    First Name:
    Bob
    This coming from you actually made me laugh. Not at the comment mind you. I laugh at the clueless poster of the the comment.
     
  11. Alien

    Alien Regular Member

    Joined:
    Mar 15, 2000
    Messages:
    0
    Likes Received:
    2
    Location:
    Zeta 2 Reticuli
    Hey Mr. Teenage-Mutant-Toaster-Strudel, and Mr. Get-Off-My-Lawn, let's cool it eh? ;)
     
  12. Carlos

    Carlos Regular Member

    Joined:
    Apr 20, 2003
    Messages:
    751
    Likes Received:
    251
    Location:
    California
    I'm laughing my ass off on how dumb you are, that didn't even make sense. I'm clueless about what? That thread at xenForo? I made you look even worse, right under your nose. ;)
    [****][****][****][****] off, stoopid lil Alien! :finger:

    [That was a joke, Alien. As you know I have nothing against you.]
     
    Alien likes this.

Share This Page