[WEB4LIB] Re: I Need an IP based url redirect Perl script

morganj at iupui.edu morganj at iupui.edu
Thu Jul 13 09:48:13 EDT 2000


Ezproxy is a very nice solution to the same problem.  It also handles the
many complex validation questions neatly - all for $500 per site.
Jim Morgan

On Wed, 12 Jul 2000 glen.davies at cce.ac.nz wrote:

> <color><param>0100,0100,0100</param>Hi
> 
> We do it the following way. Each link to a database on our web site 
> is a link to a small perl script that checks the ip, if it is on campus 
> they get automatically redirected to the database, otherwise they 
> get sent to the remote authentication page.
> 
> 
> #check to see if it is one of our ips<FontFamily><param>System</param><bigger>
> 
> </color><FontFamily><param>Arial</param><smaller>#if it is send direct to database requested<color><param>0100,0100,0100</param><FontFamily><param>System</param><bigger>
> 
> <FontFamily><param>Arial</param><smaller>if(($ENV{'REMOTE_ADDR'}) =~ /^172\.20/)
> 
>    {
> 
>      print "Location: http://search.epnet.com/ \n\n";
> 
>      exit 0;
> 
>     }
> 
> # if not on campus send to remote access page
> 
>     else
> 
>      {
> 
>      print "Location: http://lib.cce.ac.nz/remoteaccess.html \n\n";
> 
>      exit 0;
> 
>      } 
> 
> 
> 
> On 12 Jul 00, at 9:35, David P. Moore wrote:
> 
> 
> <color><param>7F00,0000,0000</param>> I am looking for a cgi Perl script that will redirct a user who clicks on a
> 
> > url to a certain web page when that user is not from an appropriate IP
> 
> > address location.
> 
> > 
> 
> > Here's why I want it: Currently, if a user from off-campus clicks on a
> 
> > database link on our web page, they will get a 404 page, or a page that
> 
> > prompts for user-name and password, causing patron confusion. This is
> 
> > because all our databases are IP authenicated for on-campus only. I want to
> 
> > redirect these non-campus patrons to a web page that will display
> 
> > instructions about obtaining off-campus access.
> 
> > 
> 
> > I have found free Perl scripts that will do right the opposite-- redirect
> 
> > based on a certain domain, but I want to redirect on any BUT a certain
> 
> > domain.
> 
> > 
> 
> > Has anyone found/using this? How are other libraries handling this issue? Is
> 
> > there a better solution?
> 
> > 
> 
> > David P. Moore
> 
> > Electronic Resources Librarian
> 
> > M. Louis Salmon Library
> 
> > University of Alabama in Huntsville
> 
> > Huntsville, AL 35899
> 
> > 256-890-6285
> 
> > FAX: 256-890-6083
> 
> > mooredp at email.uah.edu
> 
> > 
> 
> 
> 
> 

Jim Morgan
morganj at iupui.edu



More information about the Web4lib mailing list