public function action_index() { Observer::notify('frontpage_requested', $this->request->uri()); $page = Model_Page_Front::find($this->request->uri()); if ($page instanceof Model_Page_Front) { if ($page->use_redirect and !empty($page->redirect_url)) { HTTP::redirect($page->redirect_url, 301); } return $this->_render($page); } else { // Если включен поиск похожей страницы и она найдена, производим // редирект на найденую страницу if (Config::get('site', 'find_similar') == Config::YES) { if (($uri = Model_Page_Front::find_similar($this->request->uri())) !== FALSE) { HTTP::redirect(URL::frontend($uri), 301); } } Model_Page_Front::not_found(); } }