Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Want script to refuse selected browsers/dns..

Posted on 1998-01-09
4
Medium Priority
?
164 Views
Last Modified: 2013-12-25
Hi,
We are looking for a script that we can use to prevent people browsing in from our competitor's companies from seeing our web site. I know we can't prevent the same people from browsing in from home accounts, but we must do what we can. We'll be using a unix server, and can take it in perl. The first reply with a URL to a good, cheap script to download will get the 50 points, so long as it ends up working as advertised.
0
Comment
Question by:retroman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 150 total points
ID: 1831813
#!/usr/bin/perl

print "Location: ";

# Look for their hostname or IP address
if (($ENV{"REMOTE_HOST"} eq "www.competitor.com") ||
    ($ENV{"REMOTE_ADDR"} eq "192.168.0.10")){
        print "http://www.myhost.com/sorry_scumbag\n\n";
}
else{
        print "http://www.myhost.com/welcome\n\n";
}



0
 
LVL 84

Expert Comment

by:ozo
ID: 1831814
Or to prevent someone from going directly to http://www.myhost.com/welcome,
you might even try:

#!/usr/bin/perl
if( $ENV{"REMOTE_HOST"} eq "www.competitor.com") || ($ENV{"REMOTE_ADDR"} eq "192.168.0.10" ){
        open(F,"<sorry_scumbag")
}else{
        open(F,"<welcome")
}
print <F>;
close F;


(which doesn't prevent competitor.com from going through a relay,
but you do what you can)
0
 

Author Comment

by:retroman
ID: 1831815
THese both look good, but then I'm a gaper anyways. How would I modify it to prevent competitor1, competitor2, and competitor3 from accessing, and what is the difference between the two?
0
 

Author Comment

by:retroman
ID: 1831816
I'll use this one for another one of my sites. Unfortunately for me, my boss changed his mind and decided we didn't need this feature....
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
This article will show, step by step, how to integrate R code into a R Sweave document
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question