From 3c8b7d5ebf61e9018600cfc5c38176c2996c1c83 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Mon, 13 Jan 2020 18:25:51 +0100 Subject: [PATCH] redirect default path / to /cards/ --- index.cgi | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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}" -- 2.39.2