How to ensure unicity to url

Comparing #1 with #4

Content

[...]
```php
public function beforeAction($action)
{
 
if (Yii::app()->request->u
$normalizedUrl != CHtml::normalizeUrl(array_merge(array("/".$this->route), $_GET))); $this->redirect(CHtml::if (Yii::app()->request->url != $normalizedUrl && strpos($normalizedUrl(array_merge(array($this->route), $_GET)), Yii::app()->errorHandler->errorAction) === false) {
 
$this->redirect($normalizedUrl
, true, 301); }
 
return parent::beforeAction($action); }
```
[...]
public function beforeAction($action)
{

 
if (Yii::app()->request->u
$normalizedUrl != CHtml::normalizeUrl(array_merge(array("/".$this->route), $_GET))); $this->redirect(CHtml::if (Yii::app()->request->url != $normalizedUrl && strpos($normalizedUrl(array_merge(array($this->route), $_GET)), Yii::app()->errorHandler->errorAction) === false) {
 
$this->redirect($normalizedUrl
, true, 301); }
 
return parent::beforeAction($action); }
 
} ``` Notice that you cannot add this rule for actionError and actionIndex, so if you want to make unique addresses in the site controller you cannot extend the master controller, but you have to implement a special method with exception for this two actions.
 
 
Links
 
-----
 
- [Chinese version](http://www.itkuaixun.com/bbs/thread-50-1-3.html "Chinese version")