protected function recreateUriPath($uri): string
    {
        $objectManager = new ObjectManager();
        /** @var UriBuilder $uriBuilder */
        $uriBuilder = $objectManager->get(UriBuilder::class);
        if (null === ObjectAccess::getProperty($uriBuilder, 'contentObject', true)) {
            // there are situations without a valid contentObject in the URI builder
            // prevent this situation by return the original request URI
            return $uri;
        }
        $url = $uriBuilder->reset()
            ->setAddQueryString(true)
            ->setCreateAbsoluteUri(true)
            ->build();

        $parts = (array)\parse_url($url);
        $unset = ['scheme', 'user', 'pass', 'host', 'port'];
        foreach ($unset as $u) {
            unset($parts[$u]);
        }

        return HttpUtility::buildUrl($parts);
    }