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;
    }