public static function combine(string $uri1, string $uri2): string
  {
    $parts2 = parse_url($uri2);
    if (isset($parts2['scheme']) || isset($parts2['host']))
    {
      // The second URI is an absolute URI. Take all parts from second URI.
      $combined_uri_parts = $parts2;

      // The scheme might by omitted. The default scheme is http.
      if (!isset($combined_uri_parts['scheme'])) $combined_uri_parts['scheme'] = 'http';
    }
    else
    {
      $parts1             = parse_url($uri1);
      $combined_uri_parts = array_merge($parts1, $parts2);

      // Handle spacial cases for the path part of the URI.
      if (!isset($parts2['path']))
      {
        // Checking path in $uri2_parts and if path is empty, getting path from $_uri using [normalize_path]
        $combined_uri_parts['path'] = self::normalizePath($parts1['path']);
      }
      elseif (strpos($parts2['path'], '/')===0)
      {
        // Checking path in $uri2_parts and if path have '/', do nothing.
        ;
      }
      else
      {
        // Else create path using $_uri['path'] and $uri2_parts['path']. With using [normalize_path].
        $_path = $parts1['path'];
        if (strpos($_path, '/')===false)
        {
          $_path = '';
        }
        else
        {
          $_path = preg_replace('/\/[^\/]+$/', '/', $_path);
        }
        if (!isset($_path) && !isset($parts1['host']))
        {
          $_path = '/';
        }
        $combined_uri_parts['path'] = self::normalizePath($_path.$parts2['path']);
      }

      // Handle spacial cases for the query part of the URI.
      if (!isset($parts2['path']))
      {
        if (!isset($parts2['query']))
        {
          $combined_uri_parts['query'] = $parts1['query'];
        }
      }
      elseif (strpos($parts2['path'], '/')===0)
      {
        if (isset($parts2['query']))
        {
          $combined_uri_parts['query'] = $parts2['query'];
        }
        else
        {
          $combined_uri_parts['query'] = null;
        }
      }
      else
      {
        if (isset($parts2['query']))
        {
          $combined_uri_parts['query'] = $parts2['query'];
        }
        else
        {
          $combined_uri_parts['query'] = null;
        }
      }
    }

    return self::unParseUrl($combined_uri_parts);
  }