#!/usr/bin/ksh ##### # Simple redirect script # Written By : Ken Craig # See also : redirect-convert ##### # create a file in the directory $DIR (defined below) with the redirect # header information, e.g. # # Location: http://domain.com/page # # and name the file to be the same as the parameter you want to use # in your link (e.g. SOMEWHERE) # then your link should be # http://cnnfn.com/cgi-bin/ngredir?SOMEWHERE ##### PATH=/usr/bin:/usr/sbin:/usr/ucb DIR='./redirect-dir' ERRFILE="$DIR/error.html" if [ -f "$DIR/$QUERY_STRING" ]; then FILENAME="$QUERY_STRING" else typeset -l FILENAME="$QUERY_STRING" fi if [ -n "$QUERY_STRING" -a -f "$DIR/$FILENAME" ]; then print -r - "$(<"$DIR/$FILENAME")" print "\n\n\n" exit 0 fi print "Content-type: text/html\n\n" if [ -f "$ERRFILE" ]; then print -r - "$(<"$ERRFILE")" exit 0 fi print -r - "" print -r - "
" print -r - "