From: Paul Hänsch Date: Mon, 13 Jan 2020 17:25:51 +0000 (+0100) Subject: redirect default path / to /cards/ X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=3c8b7d5ebf61e9018600cfc5c38176c2996c1c83;p=lobster redirect default path / to /cards/ --- diff --git a/index.cgi b/index.cgi index 57de236..4531b0a 100755 --- a/index.cgi +++ b/index.cgi @@ -9,6 +9,8 @@ esac; done [ -z "${_EXEC%/}" ] && _EXEC="$(realpath "${0%/*}")" || _EXEC="${_EXEC%/}" [ -z "${_DATA%/}" ] && _DATA=. || _DATA="${_DATA%/}" +debug() { :; } + . "$_EXEC/cgilite/cgilite.sh" . "$_EXEC/cgilite/session.sh" @@ -54,7 +56,9 @@ yield_page() { topdir="${_PATH#/}" topdir="/${topdir%%/*}" -if [ -d "${_EXEC}/${_PATH}" -a -x "${_EXEC}/${_PATH}/index.cgi" ]; then +if [ "${_PATH}" = / ]; then + REDIRECT /cards/ +elif [ -d "${_EXEC}/${_PATH}" -a -x "${_EXEC}/${_PATH}/index.cgi" ]; then . "${_EXEC}/${_PATH}/index.cgi" elif [ ! -d "${_EXEC}/${_PATH}" -a -x "${_EXEC}/${_PATH}" ]; then . "${_EXEC}/${_PATH}"