Pretty URLs

I use yii2 advanced template. I have two different domains, one pointed to the frontend, the other to the backend. I did this using MAMP Pro.

I activated pretty urls in my config:

[

'components' => [


    'urlManager' => [


        'enablePrettyUrl' => true,


        'showScriptName' => false,


        'enableStrictParsing' => false,


        'rules' => [


            // ...


        ],


    ],


],

]

Url::to() works fine but the browser doesn’t find the pages. Do I have to put something in a .htaccess? So far I don’t have any .htaccess.

Try this link

thanks, this works - at least for controller/action but if I try controller/action/id I get an error 404 (an object with that id does exist). Do I have to tell config how to route this?

Check this

http://www.yiiframework.com/doc-2.0/guide-runtime-routing.html#url-rules

Oh, thanks, this works. But this way, I would have to make a rule for every model I have?

I just found out that the rules I used with Yii1 still work with Yii2, now I use, this does it for all models:

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