src/Sulu/Component/CustomUrl/Routing/CustomUrlRouteProvider.php
private function addHistoryRedirectToRouteCollection(
        Request $request,
        RouteDocument $routeDocument,
        RouteCollection $collection,
        $webspaceKey
    ) {
        $resourceSegment = PathHelper::relativizePath(
            $routeDocument->getTargetDocument()->getPath(),
            $this->getRoutesPath($webspaceKey)
        );

        $url = sprintf('%s://%s', $request->getScheme(), $resourceSegment);

        $collection->add(
            uniqid('custom_url_route_', true),
            new Route(
                $this->decodePathInfo($request->getPathInfo()),
                [
                    '_controller' => 'SuluWebsiteBundle:Redirect:redirect',
                    '_finalized' => true,
                    'url' => $url,
                ]
            )
        );

        return $collection;
    }
private function addHistoryRedirectToRouteCollection(
        Request $request,
        RouteDocument $routeDocument,
        RouteCollection $collection,
        $webspaceKey
    ) {
        $resourceSegment = PathHelper::relativizePath(
            $routeDocument->getTargetDocument()->getPath(),
            $this->getRoutesPath($webspaceKey)
        );

        $url = sprintf('%s://%s', $request->getScheme(), $resourceSegment);

        $collection->add(
            uniqid('custom_url_route_', true),
            new Route(
                $this->decodePathInfo($request->getPathInfo()),
                [
                    '_controller' => 'SuluWebsiteBundle:Redirect:redirect',
                    '_finalized' => true,
                    'url' => $url,
                ]
            )
        );

        return $collection;
    }
private function addHistoryRedirectToRouteCollection ( Request $ request , RouteDocument $ routeDocument , RouteCollection $ collection , $ webspaceKey ) { $ resourceSegment = PathHelper :: relativizePath ( $ routeDocument -> getTargetDocument ( ) -> getPath ( ) , $ this -> getRoutesPath ( $ webspaceKey ) ) ; $ url = sprintf ( '%s://%s' , $ request -> getScheme ( ) , $ resourceSegment ) ; $ collection -> add ( uniqid ( 'custom_url_route_' , true ) , new Route ( $ this -> decodePathInfo ( $ request -> getPathInfo ( ) ) , [ '_controller' => 'SuluWebsiteBundle:Redirect:redirect' , '_finalized' => true , 'url' => $ url , ] ) ) ; return $ collection ; }
Add redirect to current custom-url.

@param Request $request
@param RouteDocument $routeDocument
@param RouteCollection $collection
@param string $webspaceKey

@return RouteCollection
Add redirect to current custom - url .