caseSensitive strange routing behaviour

Hi there

When I browse to my ContentDetailController’s index action /contentdetail/ OR /contentDetail/ with caseSensitive set to false it doesn’t show my contentdetail.php layout file. Sometimes it loads the /views/contentDetail/index.php. When I remove the caseSensitive config setting from the main.php file, I can access the layout correctly through /contentDetail/. Is setting the caseSensitive config property the correct way to go about routing with case in Controller class names , like I have with ContentDetailController? I also tested with a controller name of DetailController.php, which worked perfectly when I accessed its actions like /detail/test.

I know I can set ruls for urlManager in the config file, but I really want some clarity on my issue.

I have the following setup:

  • Operating System: Ubuntu 11.04 running in VirtualBox

  • Web Server: Apache 2

  • Browser Type: Firefox

  • Version 1.1.9 January 1, 2012






class ContentDetailController extends BaseController


    public $layout = '//layouts/contentdetail';


	public function actionIndex()








'caseSensitive' => false,


<?php $this->beginContent('//layouts/main'); ?>

<div class="container_12">



<?php $this->endContent(); ?>

My Application Log output

10:20:48.186086 	error 	exception.CHttpException.404 	

exception 'CHttpException' with message 'Unable to resolve the request

"contentdetail".' in


Stack trace:

#0 /var/www/tracc/yii/framework/web/CWebApplication.php(135):


#1 /var/www/tracc/yii/framework/base/CApplication.php(162):


#2 /var/www/tracc/wgll/frontend/www/index.php(34): CApplication->run()

#3 {main}



Hi Bjorn,


When you have a Controller, to get its url route case sensitive is lowercase the first character and remove the word Controller. So If you have


its url would be




When your request can not be resolved to the controller specifying the layout, you of course can not see page in that layout, because SiteControllers actionError ist loaded instead of ContentDetailController.

I know I have to access the controller /contentDetails/, but I don’t want to. I want to be able to access it /contentdetail/ wihtout renaming my controller

Seems to be a bug, I created an issue on google code:

EDIT: just seen that commend from qiang:

Guess this isn’t easy to solve, maybe controllerMap as mentioned in that issue can help you…

Hi Bjorn,

please read this comment:

It should give you all information you need to solve your problem.

Jip, that solved my problem. Thanks alot!

It would be bit of a shlep to add maps for all controllers having the same type of naming connvetion as mine. One would hope that caseSensitive will work as expected :slight_smile: