$website = CMS_websitesCatalog::getMainWebsite(); } $rootPage = $website->getRoot(); if ($rootPage->getPublication() == RESOURCE_PUBLICATION_PUBLIC) { //redirect to subpage if any $redirectlink = $rootPage->getRedirectLink(true); while ($redirectlink && $redirectlink->hasValidHREF() && sensitiveIO::IsPositiveInteger($redirectlink->getInternalLink())) { $rootPage = new CMS_page($redirectlink->getInternalLink()); if ($rootPage->getPublication() == RESOURCE_PUBLICATION_PUBLIC) { $redirectlink = $rootPage->getRedirectLink(true); } else { $redirectlink = ''; } } } $pPath = $rootPage->getHTMLURL(false, false, PATH_RELATIVETO_FILESYSTEM); if ($pPath) { if (file_exists($pPath)) { $cms_page_included = true; require $pPath; exit; } elseif ($rootPage->regenerate(true)) { clearstatcache(); if (file_exists($pPath)) { $cms_page_included = true; require $pPath; exit; } } } CMS_view::redirect(PATH_SPECIAL_PAGE_NOT_FOUND_WR, true, 301);