createUrl still puts the index.php in my URLs


i call

localhost/testproject/index.php/site/index and


in my browser and both show the same result, so i guess rewrite rules etc work fine.


<a href="<?= $this->createUrl("site/index") ?>">test</a>



still create URLs with index.php in it. I dont understand that. how can i make createUrl using my rules to create Urls without index.php? i thought ‘showScriptName’ => false would cause that.

my .htaccess in root:

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

the urlManager:

'urlManager' => array(

            'showScriptName' => false,

            'urlFormat' => 'path',

            'rules' => array(

                '<controller:\w+>/<id:\d+>' => '<controller>/view',

                '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',

                '<controller:\w+>/<action:\w+>' => '<controller>/<action>',



i solved the problem.

the code above works fine but i redeclared the urlManager in my main.php in former times at the bottom of the config file. pretty dumb ;)

-> close