Remove Index NOT index.php











if I make that array to have just


instead of


, it works. BUT that’s not the proper way of doing it, according to the documentation AND, as a plus, YII don’t place the active class on it.

For almost all controllers I have an index action but I wish the URL to be without that /index .

I’ve removed the index.php file, but this index still appears.

Is there a way to remove it ?

which page u want to show?

@mem: read

I’m having the same problem. I have following the “Special Topics” documentation, but “index” still appears in the URL.

My .htaccess:

 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

In my /protected/config/main.php, urlManager is set to:











If I enter into the browser:

it works as expected (displayed actionIndex()).

Also, entering into the browser:

works as expected.

However, when I create an URL with a parameter using createUrl, like so:

$url = Yii::app()->createUrl('controller/index', array('somevar' => 123));

then the URL displayed in the browser is:

This is not desirable. What else needs to be done to remove "index" from the URL so that the above example would be:

when using createUrl?