*/ class DuplicateFilter extends CFilter { /** * Performs the pre-action filtering. * @param CFilterChain $filterChain the filter chain that the filter is on. * @return boolean whether the filtering process should continue and the action * should be executed. */ protected function preFilter($filterChain) { $requestUri = Yii::app()->request->requestUri; if (Yii::app()->urlManager->showScriptName === false && preg_match('~^/index\.php(.*)~', $requestUri, $matches)) { Yii::app()->request->redirect($matches[1]); return false; } return parent::preFilter($filterChain); } }