mirror of
https://gitlab.com/niansa/simpsh-httpd.git
synced 2025-03-06 20:53:36 +01:00
19 lines
381 B
Bash
19 lines
381 B
Bash
#! /bin/bash
|
|
|
|
# Blockiere Versuche, das restliche Dateisystem zu lesen
|
|
if [[ "$URL" == *..* ]]; then
|
|
export URL='/'
|
|
export FILE="$FILES"
|
|
fi
|
|
|
|
# Verhindere "/"-bug
|
|
if [ -d "$FILE" ]; then
|
|
if [[ "$URL" != */ ]]; then
|
|
#newURL="$URL"'/'
|
|
#export URL="$newURL"
|
|
#newFILE="$FILE"'/'
|
|
#export FILE="$newFILE"
|
|
echo 'HTTP/1.0 302 Moved permanently
|
|
Location: '"${WEBSITE}${URL}"'/'
|
|
fi
|
|
fi
|