#!/usr/bin/env bash uri="${REQUEST_SCHEME:-http}://${HTTP_HOST}${PATH_INFO,,}" if test -n "$QUERY_STRING"; then uri+="?$QUERY_STRING" fi printf '%s\r\n' \ "Location: $uri" \ ''