About Prettyurl's Question

In main.php, I set UrlManager:

‘urlManager’ => [

‘enablePrettyUrl’ => true,

‘showScriptName’ => false,

‘suffix’ => ‘.htm’,


and i can use /site/index.htm to access the website.

And i cannot use /index.php?r=site/index.

But I want use both. Because i use it in js file early.

Can someone help me…



I think you can use site/index ( or just index if you are already in the site controller) in your js file

not /index.php?r=site/index

do you have a code sample?