Changes
Title
unchanged
Changing Controllers Name
Category
unchanged
How-tos
Yii version
unchanged
Tags
unchanged
newbie, controllers
Content
changed
[...]
If you are using standard (autogenerated) configuration file, there are some default URL-rewriting rules and application and/or module can be accessed via URLs like these:
```php
http://{server_address}/{application_path}/site/index.html
http://{server_address}/{application_path}/{controller_imoduleId}/default/index.html
```[...]
If you wish to change not only URLs (which can be done with URL Management --> see [here](http://www.yiiframework.com/doc/guide/1.1/en/topics.url "URL Management")), but also controllers names (for example for some files and folders structure cleanup or for satisfying defined name nomenclature), you will have to undertakes theses four steps:
1. Change controller's file name, for example from _SiteController.php_ to _MainController.php_".
2. Edit this controller file and change class name, in the first code line, for example from _SiteController_ to _MainController
_" (see end of this chapter).
3. Change views folder name, for example from _protected/views/site_ to _protected/views/main_.
4. If this is main (default, major) controller, edit application configuration file and inform Yii about change in application or module default controller name.
For application:[...]