Solved

Want script to refuse selected browsers/dns..

Posted on 1998-01-09
4
153 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 50 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

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

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

Suggested Solutions

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

735 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