private function parseRewriteRules( Array $rewrite ) {
        $this->error = '404';
        $request_match = $this->request;
        if ( empty( $request_match ) && isset( $rewrite['$'] ) ) {
            $this->matched_rule = '$';
            $matches = [ '' ];
            $query = $rewrite['$'];
        } else {
            foreach ( (array) $rewrite as $match => $query ) {
                $matches = $this->parseRewriteRule( $match, $query );
                if ( ! is_null( $this->matched_rule ) ) {
                    return [ $matches, $query ];
                }
            }
        }
        return [ $matches, $query ];
    }