CHttpException

Page is not found

/srv/www/apppicker.com/htdocs/protected/controllers/SiteController.php(23)

11         );
12     }
13 
14     public function actionRedirect($year, $month, $day, $slug)
15     {
16         $post = Article::loadArticleByDateSlug($year, $month, $day, $slug);
17 
18         if($post){
19             $link = ViewHelper::createArticleLink($post->id, $post->slug, ViewHelper::getArticleTypeName($post->type));
20             header ('HTTP/1.1 301 Moved Permanently');
21             header ('Location: '.$link);
22         } else {
23             throw new CHttpException(404, "Page is not found");
24         }
25     }
26 
27     public function actionRedirectslug($slug)
28     {
29         $post = Article::loadArticleBySlug($slug);
30 
31         if($post){
32             $link = ViewHelper::createArticleLink($post->id, $post->cv->slug, ViewHelper::getArticleTypeName($post->type));
33             header ('HTTP/1.1 301 Moved Permanently');
34             header ('Location: '.$link);
35         } else {

Stack Trace

#9
+
 /srv/www/apppicker.com/htdocs/index.php(58): CApplication->run()
53 
54 if (!isset($app->params[Configuration::PREFIX_ELASTICA]) || $app->params[Configuration::PREFIX_ELASTICA] == null || $app->params[Configuration::PREFIX_ELASTICA] == '') {
55     $app->params->add(Configuration::PREFIX_ELASTICA, '1');
56 }
57 
58 $app->run();
2024-03-28 08:15:21 nginx/1.20.1 Yii Framework/1.1.16