phpyii2yii2-extension

yii2 localurls - language appended at the end of the url


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


Solution

  • You should enable pretty urls.

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

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