public function redirectPageSEO301($e, $idpage)
    {
    	$sm = $e->getApplication()->getServiceManager();
        $router = $e->getRouter();
        $uri = $router->getRequestUri();
         
        // Check for defined SEO 301 redirection
        $uri = $uri->getPath();
        if (substr($uri, 0, 1) == '/')
            $uri = substr($uri, 1, strlen($uri));
        $melisTablePageSeo = $sm->get('MelisEngineTablePageSeo');
        $datasPageSeo = $melisTablePageSeo->getEntryById($idpage);
        if (!empty($datasPageSeo))
        {
            $datasPageSeo = $datasPageSeo->current();
            if (!empty($datasPageSeo) && !empty($datasPageSeo->pseo_url_301))
            {
                if (substr($datasPageSeo->pseo_url_301, 0, 4) != 'http')
                    $newuri = '/' . $datasPageSeo->pseo_url_301;
                else
                    $newuri = $datasPageSeo->pseo_url_301;

                $newuri .= $this->getQueryParameters($e);
                    
                return $newuri;
            }
        }
        
        return null;
    }
public function redirectPageSEO301($e, $idpage)
    {
    	$sm = $e->getApplication()->getServiceManager();
        $router = $e->getRouter();
        $uri = $router->getRequestUri();
         
        // Check for defined SEO 301 redirection
        $uri = $uri->getPath();
        if (substr($uri, 0, 1) == '/')
            $uri = substr($uri, 1, strlen($uri));
        $melisTablePageSeo = $sm->get('MelisEngineTablePageSeo');
        $datasPageSeo = $melisTablePageSeo->getEntryById($idpage);
        if (!empty($datasPageSeo))
        {
            $datasPageSeo = $datasPageSeo->current();
            if (!empty($datasPageSeo) && !empty($datasPageSeo->pseo_url_301))
            {
                if (substr($datasPageSeo->pseo_url_301, 0, 4) != 'http')
                    $newuri = '/' . $datasPageSeo->pseo_url_301;
                else
                    $newuri = $datasPageSeo->pseo_url_301;

                $newuri .= $this->getQueryParameters($e);
                    
                return $newuri;
            }
        }
        
        return null;
    }
public function redirectPageSEO301 ( $ e , $ idpage ) { $ sm = $ e -> getApplication ( ) -> getServiceManager ( ) ; $ router = $ e -> getRouter ( ) ; $ uri = $ router -> getRequestUri ( ) ; // Check for defined SEO 301 redirection $ uri = $ uri -> getPath ( ) ; if ( substr ( $ uri , 0 , 1 ) == '/' ) $ uri = substr ( $ uri , 1 , strlen ( $ uri ) ) ; $ melisTablePageSeo = $ sm -> get ( 'MelisEngineTablePageSeo' ) ; $ datasPageSeo = $ melisTablePageSeo -> getEntryById ( $ idpage ) ; if ( ! empty ( $ datasPageSeo ) ) { $ datasPageSeo = $ datasPageSeo -> current ( ) ; if ( ! empty ( $ datasPageSeo ) && ! empty ( $ datasPageSeo -> pseo_url_301 ) ) { if ( substr ( $ datasPageSeo -> pseo_url_301 , 0 , 4 ) != 'http' ) $ newuri = '/' . $ datasPageSeo -> pseo_url_301 ; else $ newuri = $ datasPageSeo -> pseo_url_301 ; $ newuri .= $ this -> getQueryParameters ( $ e ) ; return $ newuri ; } } return null ; }
This function handles the basic SEO 301 for Melis pages.
This will be used when a page is unpublished

@param MvcEvent $e
@param int $idpage
@return string|NULL The URL of the 301 page defined in SEO
This function handles the basic SEO 301 for Melis pages . This will be used when a page is unpublished