The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

cgi-bin/redirect.pl - CGI program to redirect client while logging access

SYNOPSIS

  cgi-bin/redirect.pl

DESCRIPTION

redirect.pl is a Common Gateway Interface (CGI) program which takes a URL as its parameter and tries to redirect its HTTP client to this URL, whilst at the same time logging the URL which is being redirected to. This provides a simple way of logging the accesses to resources which are being catalogued using the ROADS software, and can in fact be used for this purpose with any URL.

FILES

Redirected URLs are normally logged to the file redirect-hits, in the ROADS logs directory, though if the program is called using another name, this will be reflected in the filename prefix, e.g. wibble-hits if the program is launched as wibble.

FILE FORMAT

Each redirected URL is logged on a line of its own.

BUGS

Depending on the HTTP server you use, it may be necessary to run this program as nph-redirect.pl rather than redirect.pl. Some HTTP servers (e.g. Apache versions post 1.2) automatically detect when a CGI program creates its own HTTP headers, and others require use of the nph- naming convention to indicate a program which will do this.

COPYRIGHT

Copyright (c) 1988, Martin Hamilton <martinh@gnu.org> and Jon Knight <jon@net.lut.ac.uk>. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

It was developed by the Department of Computer Studies at Loughborough University of Technology, as part of the ROADS project. ROADS is funded under the UK Electronic Libraries Programme (eLib), the European Commission Telematics for Research Programme, and the TERENA development programme.

AUTHOR

Jon Knight <jon@net.lut.ac.uk>