#!/bin/sh -r if [ $REMOTE_HOST = localhost ]; then url="http://localhost:$SERVER_PORT" else url="http://$SERVER_NAME:$SERVER_PORT" fi smartstring=`echo $PATH_INFO | sed "s/^\///g"` logicalpath=`htmlsearch alldocs.db link="$smartstring" | tail -1 | sed "s/ .*//g"` quotepath=`echo $PATH_INFO | sed "s/\//\\\\\\\\\//g"` rootpath=`echo $PATH_TRANSLATED | sed "s/$quotepath\$//g"` fullpath=$rootpath/$logicalpath if [ -r $fullpath ]; then # echo Content-Type: text/plain # echo "" echo Location: $url/$logicalpath echo ""; exit 0; fi echo Content-Type: text/html echo "" echo "

Invalid smartlink found.

"