1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Buying Prevent Hotlinking with .htaccess (ASAP)

Discussion in 'Programming' started by le3on9, Nov 6, 2011.

  1. #1
    Hello, I am looking for someone who can help me prevent other sites from hotlinking to my site.
    I need someone to help me add some code to prevent many specific sites.
    I need this done ASAP and I know this is simple, but I want to it be done correctly without any errors.

    I know this is an easy job, so $5 in paypal to anyone who can help me.
     
    le3on9, Nov 6, 2011 IP
  2. KangBroke

    KangBroke Notable Member

    Messages:
    1,026
    Likes Received:
    59
    Best Answers:
    4
    Trophy Points:
    265
    As Seller:
    100% - 6
    As Buyer:
    100% - 7
    #2
    To stop hotlinking of your images from other sites and display a replacement image called qX4w7.gif from an image host, place this code in your .htaccess file:

    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]


    The first line of the above code begins the rewrite. The second line matches any requests from your own mysite.com url. The [NC] code means "No Case", meaning match the url regardless of being in upper or lower case letters. The third line means allow empty referrals. The last line matches any files ending with the extension jpeg, jpg, gif, bmp, or png. This is then replaced by the qX4w7.gif image from the imgur.com server. You could easily use your own hotlink image by placing an image file in your site's directory and pointing to that file instead.




    simple as that, Paypal is
     
    Last edited: Nov 6, 2011
    KangBroke, Nov 6, 2011 IP
  3. KangBroke

    KangBroke Notable Member

    Messages:
    1,026
    Likes Received:
    59
    Best Answers:
    4
    Trophy Points:
    265
    As Seller:
    100% - 6
    As Buyer:
    100% - 7
    #3
    Let me be the example and show you guys why you should not help new users unless they pay first, He stayed online for 20 mins and I pm'ed him, Im sure my fix did what he wanted also
     
    KangBroke, Nov 6, 2011 IP
    JimmyRP likes this.
  4. ademmeda

    ademmeda Active Member

    Messages:
    354
    Likes Received:
    3
    Best Answers:
    3
    Trophy Points:
    70
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #4
    @KangBroke: This is not the help forum, this is BST forum and you shouldn't post any solutions here. Help and paid work are two different things and you should make a distinction while approaching clients.
     
    ademmeda, Nov 7, 2011 IP
    KangBroke likes this.