Set Error For Urls

Hi everybody,

I have Url rules in my main.php


  '<community:(ukuya|mspc)>' => '/social',

  '<community:(ukuya|mspc)>/<module:\w+>/' => '<module>',

  '<community:(ukuya|mspc)>/<module:\w+>/<controller:\w+>/' => '<module>/<controller>',


  '<community:(ukuya|mspc)>/<module:\w+>/<controller:\w+>/<action:\w+>' => '<module>/<controller>/<action>',								


I have to set errors for wrong community or module.

my error action:


	// use 'site/error' action to display errors



when I type or

this gives me same error message.

but I need, error message like

Wrong community or

Wrong module

any idea?


I don’t know if this is the best solution, but it’s an idea:

public function actionError()




       if(!in_array($_GET['community'], array('ukuya','mspc')))

           $error['message']='Wrong community';


       $this->render('error', $error);



Thank you for your reply.

I think you’re right.

But there has to be best solution for this.

Anyways I did somethin like this, it is working right now

  if(isset($error['code']) && $error['code']===404)


    if(strpos($error['message'], "Unable to resolve the request") === 0)


        $error['message'] = $this->checkError(






  $this->render('error', $error);

checked error message in my own function.