Hotlinking ?

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

  1. 2dub

    2dub Regular Member

    157
    26
    364
    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

    6,602
    1,707
    918
    I'm sure you can and the .htaccess file, but I don't know how off hand.
     
  3. Cerberus

    Cerberus Admin Talk Staff

    1,031
    500
    818
    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

    157
    26
    364
    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

    1,031
    500
    818
    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 Admin Talk Staff

    1,616
    693
    818
    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

    529
    232
    418
    If that no permission image is meatspin I'll bet those bastards will stop stealing from you quickly.
     
  8. AWS

    AWS Administrator Admin Talk Staff

    1,616
    693
    818
    I had goatsee for a while. Now it's tame.
     
  9. Carlos

    Carlos Regular Member

    751
    251
    462
    You're an @$$hole, ain'tchoo?

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

    AWS Administrator Admin Talk Staff

    1,616
    693
    818
    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

    0
    2
    604
    Hey Mr. Teenage-Mutant-Toaster-Strudel, and Mr. Get-Off-My-Lawn, let's cool it eh? ;)
     
  12. Carlos

    Carlos Regular Member

    751
    251
    462
    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