<html>
<body>
<font size=3>Well, that was easy. Now I feel dumb.<br>
Thank you.<br><br>
<br>
At 12:51 PM 12/23/2015, Don Drake wrote:<br><br>
<blockquote type=cite class=cite cite="">Take a look at this
example:<br><br>
<a href="http://www.oreilly.com/openbook/cgi/ch03_07.html">
http://www.oreilly.com/openbook/cgi/ch03_07.html</a><br><br>
<br>
</font><pre>#!/usr/local/bin/perl
$remote_host = $ENV{'REMOTE_HOST'};
print "Content-type: text/plain", "\n";
if ($remote_host eq "<a href="http://bu.edu">bu.edu</a>") {
        print "Status: 200
OK", "\n\n";
        print "Great! You are
from Boston University!", "\n";
} else {
        print "Status: 400 Bad
Request", "\n\n";
        print "Sorry! You need to
access this from Boston University!", "\n";
}
exit (0);
</pre><font size=3><br><br>
-Don<br><br>
--<br>
Don
Drake<a href="http://www.drakeconsulting.com">www.drakeconsulting.com</a>
<br>
<a href="http://www.maillaunder.com/" eudora="autourl">
www.maillaunder.com</a><br>
312-560-1574<br>
800-733-2143 <br><br>
<blockquote type=cite class=cite cite="">On Dec 23, 2015, at 11:43 AM,
Jim Jacobus
<<a href="mailto:JJacobus@ponyx.com">JJacobus@PonyX.com</a>>
wrote:<br><br>
<br>
How to I create a 404 error from a cgi-bin script. I know the message
needs to be before any other text, but I'm having trouble with this.<br>
Background: I have a script that is indexed by all the search engines. It
has a parameter which is a item number (e.g.
<a href="http://example.com/cgi-bin/script.pl?nnnnnn">
http://example.com/cgi-bin/script.pl?nnnnnn</a> ) where nnnnnn is a item
number. The script figures out if this is a current item number and
forwards it to an HTML page if it is. If it isn't a current item number,
I create a page that is a similar product. The item numbers (nnnnnn) are
added and deleted all the time. I want the search engines to stop
indexing expired items, so I want to create a 404 error but still produce
a page for the end user.<br><br>
I thought there was a simple print statement I needed to write out, but
I'm having trouble figuring out what it is.<br>
Thanks in advance.<br>
Jim<br><br>
_______________________________________________<br>
Chicago-talk mailing list<br>
<a href="mailto:Chicago-talk@pm.org">Chicago-talk@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/chicago-talk" eudora="autourl">
http://mail.pm.org/mailman/listinfo/chicago-talk</a></blockquote><br>
_______________________________________________<br>
Chicago-talk mailing list<br>
Chicago-talk@pm.org<br>
<a href="http://mail.pm.org/mailman/listinfo/chicago-talk" eudora="autourl">
http://mail.pm.org/mailman/listinfo/chicago-talk</a></font></blockquote>
</body>
</html>