+ Post New Thread
Results 1 to 3 of 3
Web Development Thread, blocking hotlinking and adding adverts in Coding and Web Development; On my webspace I am hosting a load of (perfectly legal) MP3 mixes, of some local glasgow DJs. These links ...
  1. #1

    RabbieBurns's Avatar
    Join Date
    Apr 2008
    Location
    Sydney
    Posts
    5,527
    Thank Post
    1,339
    Thanked 470 Times in 307 Posts
    Blog Entries
    6
    Rep Power
    200

    blocking hotlinking and adding adverts

    On my webspace I am hosting a load of (perfectly legal) MP3 mixes, of some local glasgow DJs.

    These links have been spread via forums, facebook etc whatever and ive just checked the logs and im now getting about 1000 hits a month and most of them are direct hits, meaning they are just grabbing the files directly.

    The webhost hasn't pulled me up yet but its only a matter of time, so was hoping to disable hotlinking to force folk to actually click on a link and view the page which I would put some subtle ads on whicn could hopefully pay for a bigger hosting package

    Anyone got any experience with this?

  2. #2
    jamiess's Avatar
    Join Date
    Oct 2009
    Location
    Balsall Common
    Posts
    72
    Thank Post
    10
    Thanked 20 Times in 17 Posts
    Rep Power
    14
    Rabbieburns,

    One way to block hotlinking is to create a .htaccess file. This should sort it out.

    PHP Code:
    RewriteEngine on
    RewriteCond 
    %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://(www\.)?domain.com/.*$ [NC]
    RewriteRule \.(gif|jpg)$ http://www.domain.com/nohotlinking.html [R,L] 
    You need to change domain.com to your domain, the last domain will redirect the hot linkers to the domain of your choice.

    As for the ads i would recommend Online Advertising Marketplace | BuySellAds.com

    Jamie

  3. Thanks to jamiess from:

    RabbieBurns (27th November 2011)

  4. #3

    nephilim's Avatar
    Join Date
    Nov 2008
    Location
    Dunstable
    Posts
    12,086
    Thank Post
    1,638
    Thanked 1,957 Times in 1,431 Posts
    Blog Entries
    2
    Rep Power
    440
    your webhost should be able to block hotlinking directly to your links, which would make them only available through your site. However the above method works well as well.

  5. Thanks to nephilim from:

    RabbieBurns (27th November 2011)

SHARE:
+ Post New Thread

Similar Threads

  1. Blocking .EXE and COM etc on a new Windows 2003 Domain Help!
    By bigb3n in forum Network and Classroom Management
    Replies: 11
    Last Post: 22nd February 2013, 03:30 PM
  2. Replies: 10
    Last Post: 5th February 2009, 05:46 PM
  3. ISA 2006 + blocking internet for AD group
    By Paid_Peanuts in forum Windows
    Replies: 8
    Last Post: 7th December 2007, 06:46 PM
  4. VNC and AD
    By monkeyx in forum Coding
    Replies: 20
    Last Post: 16th March 2007, 07:40 PM
  5. VNC and AD
    By monkeyx in forum Network and Classroom Management
    Replies: 4
    Last Post: 12th March 2007, 02:58 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •