Jump to content


.htaccess


1 reply to this topic

#1 HiJinks

    Young Padawan

  • Members
  • Pip
  • 10 posts

Posted 24 March 2007 - 08:00 PM

I've found tons of tutorials on stopping CERTAIN sites from leeching, but I want all sites except the ones I specify from leeching, mainly because I have a mp3 player and I don't want a bunch of assholes stealing the code and me paying tons of money for bandwidth ;)

#2 Demonslay

    P2L Jedi

  • Members
  • PipPipPip
  • 970 posts
  • Gender:Male
  • Location:A strange world where water falls out of the sky... for no reason.
  • Interests:Graphic Design, Coding, Splinter Cell, Cats

Posted 25 March 2007 - 11:24 AM

Well, you could show us the scripts you've found, and you can easily reverse the logic of it.

For example, if it works off the referrer, you could do something like this.

$allowed_sites = array('www.site.com'); // Just whatever sites you want to allow

$found = false;

foreach($allowed_sites as $site){
if(stristr($_SERVER['HTTP_REFERER'], $site)) $found = true;
}

if($found === false) die('You cannot view this page'); // Or whatever you want to do to deny access

Just a simple example off the top of my head, and wouldn't be the most effective to be honest, but should give you an idea of how you could do something like this.

Edit:
Opps, I just realized you were talking about a .htaccess method, not a PHP. :blink:
Um, I've never done something like that with .htaccess, but it would be about the same logic and what not. Still, maybe show us one of the scripts you were looking at.

Edited by Demonslay, 25 March 2007 - 11:25 AM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users