src/Controller/FrontendPageController.php
public function getRedirect(Request $request, PageInterface $page)
    {
        if (method_exists($page, 'getAlias') && $page instanceof PageInterface) {
            if ($alias = $page->getAlias()) {
                $alias->getFullPath();
                $baseUrl = $request->getBaseUrl();

                $route = ContentRouteManager::generateRoute($alias->getContentRoute(), $alias->getFullPath(), '');

                return new RedirectResponse($baseUrl.$route->getPath());
            }
        }

        return false;
    }
public function getRedirect(Request $request, PageInterface $page)
    {
        if (method_exists($page, 'getAlias') && $page instanceof PageInterface) {
            if ($alias = $page->getAlias()) {
                $alias->getFullPath();
                $baseUrl = $request->getBaseUrl();

                $route = ContentRouteManager::generateRoute($alias->getContentRoute(), $alias->getFullPath(), '');

                return new RedirectResponse($baseUrl.$route->getPath());
            }
        }

        return false;
    }
public function getRedirect ( Request $ request , PageInterface $ page ) { if ( method_exists ( $ page , 'getAlias' ) && $ page instanceof PageInterface ) { if ( $ alias = $ page -> getAlias ( ) ) { $ alias -> getFullPath ( ) ; $ baseUrl = $ request -> getBaseUrl ( ) ; $ route = ContentRouteManager :: generateRoute ( $ alias -> getContentRoute ( ) , $ alias -> getFullPath ( ) , '' ) ; return new RedirectResponse ( $ baseUrl . $ route -> getPath ( ) ) ; } } return false ; }
Check if page is an alias for another page.

@param Request       $request
@param PageInterface $page

@return bool|RedirectResponse
Check if page is an alias for another page .