yii2 localurls - language appended at the end of the url

140 Views Asked by At

I am using Yii2 and the extension localurls

I have followed the instructions but it seems the language is appended to the end of the URLs instead of before the script name:

http://localhost/yii/advanced/frontend/web/index.php/en

Also, I have tried to disable the option "showScriptName" and the URL:

http://localhost/yii/advanced/frontend/web/en

is not found -> 404 not found. Why so?

Thank you

1

There are 1 best solutions below

3
On BEST ANSWER

You should enable pretty urls.

 ...
'urlManager' => [
    ...
    'enablePrettyUrl' => true,
    ...
]
...

You should also have correct rewrite part in your web server config.