1 2 3 4 5 6 7 8
#!/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" \ ''