Well, PHP time.
My client wants me to use Yii2 as the framework for my project.
I have earned. No problems. I used an advanced template using composer.
Install my web root in / frontend / web etc.
NOW, I want to use this URL format
website.com/messages/or website.com/messages/tom ... etc.
Currently, the setup path is shown by website.com/index.php?r=messages/index ...
I found this documentation ...
https://github.com/yiisoft/yii2/blob/master/docs/guide/url.md
But I can’t understand how it turns out.
Here are my steps ...
I configured the Apache server to specify / usr / www / payroll / frontend / web /
I added a .htaccess file with this content to my web folder.
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
urlManager . , .
'components'=>[
'urlManager' => [
'class' => 'yii\web\UrlManager',
'enablePrettyUrl' => true,
'showScriptName' => 'false'
],
],
, website.com, , /site/index url. ( url /index.php?site/index)
, , url ( UrlManager), 404
. Php, Apache Yii2. , .