Works In Dev Enviroment And Not In Production!

Hi All,

I have my site ready to be on production environment, so I have upladoed to the server all files and my surprise was when I fount out that some things doesn’t work!

Many links doesn’t find the correct url and I just don’t know why, I’m using modules and I don’t know if it’s a problem. For instance, I have the following CMenu:

$this->widget('zii.widgets.CMenu', array(




    'htmlOptions'=>array('class'=>'nav nav-list account-sidenav'),


        array('label'=>'<i class="ico-eye-open"></i> Preview', 




        array('label'=>'<i class="ico-edit"></i> Edit Cause', 




        array('label'=>'<i class="ico-picture"></i> Images', 

              'url'=>array('/causes/cause/image', 'id'=>$id),



        array('label'=>'<i class="ico-chat"></i> Comments', 






The first three links, in the controller ‘cause’, works perfectly, but the link for the controller ‘causecontroller’ doesn’t work, showing the error:

Error 404

Unable to resolve the request "causes/causecomment/index/id/1".

This is what I have in my config/main:


    'urlFormat'=>'path','showScriptName'=>false, 'caseSensitive'=>false,








And in my .htaccess in my webroot:

RewriteEngine on

# if a directory or a file exists, use it directly

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php

RewriteRule . index.php

I have read the follow documentation:

Using search engine and user friendly urls

Using custom url rule classes

And I don’t know why this is happening because it works in my localhost!!! this happens in other places in my site, not only in the CMenu, also in a button:

$this->widget('bootstrap.widgets.TbButton', array(


    'url'=>Yii::app()->createUrl('/causes/causecomment/create', array('id'=>$model->id)),





I don’t know why it can’t resolve the url for a different controller than ‘cause’.

Could someone help me with this? it’s really frustrating, thanks in advance.

There is a good chance you are moving from a Windows to Linux environment. When on Linux, letter casing matters.

For example, if your controller is CauseCommentController, your URL needs to be "/causes/causeComment/create". Also be sure to change the view folder name.

Hi chuntley,

thanks for your quick response, my localhost is under windows and on production I have a linux machine, but I also tried to change the letter cases, like:

array('label'=>'<i class="ico-chat"></i> Comments', 




And it doesn’t work either. My view folder names are like this ‘causeComment’ and the controller, as you said, CauseCommentController, so all seems to be ok, any other suggestion?

Your long route paths indicate that you’re using modules - check your directory permissions. Also, if you’re going to hide index.php your .htaccess file should look as documented here. Good luck.

This is almost certainly a case sensitivity issue.

Make sure that your controller file is called CauseCommentController.php and the class is named CauseCommentController with those exact cases.

If you can link us to the live site, it might be easier to help.

Thank you both, I really appreciate your help.

As you can see in my first post, my .htaccess is exactly like in that link. I do use modules, the folder permissions are 705 and the files permissions are 604, which I think is correct.

I quite sure is not due to case sensitivity issue, I have checked many times and it seems ok:


class CauseCommentController extends Controller

If it was due to sensitivity issue, I guess the same thing would happen for the other links like:

array('label'=>'<i class="ico-eye-open"></i> Preview', 




It’s strange to me that actions in CauseController works perfectly fine and from a view in cause folder calling to a CommentController action or another controller action diffenrent than CauseController doesn’t work. This is driving me nuts.

Thanks again

I have some news…

Just for testing, I have changed the controller’s name, where I had ‘CauseCommentController’, now I have ‘CommentController’, then my links:

array('label'=>'<i class="ico-chat"></i> Comments', 




and… surprise!!! It works! I just don’t have any idea why keeping the other name doesn’t work, before changing every controller’s name I would like to find the solution, is this issue make any sense to you guys?

Thanks again for your responses