[9463] in www-talk@info.cern.ch
Re: server redirects by client domain
daemon@ATHENA.MIT.EDU (Michael Niksch)
Thu Dec 14 11:56:35 1995
From: "Michael Niksch" <nik@zurich.ibm.com>
Date: Thu, 14 Dec 1995 17:44:04 +0100
To: www-talk@w3.org
In-Reply-To: Martin Hamilton <martin@mrrl.lut.ac.uk>
"server redirects by client domain" (Dec 14, 14:28)
Resent-From: www-talk@w3.org
With the CERN server you could probably map everything to a CGI script
Exec /cgi-bin/* /usr/local/httpd/cgi-bin/*
Map /* /cgi-bin/redirect/*
The /usr/local/httpd/cgi-bin/redirect script would look like
#!/bin/ksh
case "$REMOTE_HOST" in
*.au | *.nz | *.jp | *.kr )
url="http://Bond.edu.au/External/Misc/apache${PATH_INFO}"
;;
*.at | *.de | *.dk )
url="http://iuinfo.tuwien.ac.at/apache${PATH_INFO}"
;;
* )
url="http://sunsite.doc.ic.ac.uk/packages/apache${PATH_INFO}"
;;
esac
print "$Location: $url"
print "Content-Type: text/html"
print
print "<HTML><HEAD><TITLE>Redirect</TITLE></HEAD><BODY>"
print "<A HREF=\"$url\">Click here!</A>"
print "</BODY></HTML>"
--
Michael Niksch TEL: +41-1-7248-913
IBM Zurich Research Laboratory FAX: +41-1-7240904
Saeumerstrasse 4 nik@zurich.ibm.com (NIK at ZURICH)
CH-8803 Rueschlikon / Switzerland http://www.zurich.ibm.com/~nik/