]> git.plutz.net Git - lobster/commitdiff
redirect default path / to /cards/
authorPaul Hänsch <paul@plutz.net>
Mon, 13 Jan 2020 17:25:51 +0000 (18:25 +0100)
committerPaul Hänsch <paul@plutz.net>
Mon, 13 Jan 2020 17:25:51 +0000 (18:25 +0100)
index.cgi

index 57de2367ddc95a85850be7ab19b687f52115429a..4531b0ad608a84c215a9a8b64cd9f00ae0568543 100755 (executable)
--- 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}"