Correctly deal with cases where SCRIPT_NAME is not part of REQUEST_URI