Write an interface that uses the path to Localhost/api/web/index.php?r=user/test
Actiontest's code is echo ' 123 ';
According to the online tutorial, the Urlmanager is configured, the code is as follows
'urlManager' => [ 'enablePrettyUrl' => true, //美化url==ture 'enableStrictParsing' => false, //不启用严格解析 'showScriptName' => false, //隐藏index.php 'rules' => [ '
/'=>'
/', ], ],
Then the Nginx rewrite is configured.
Listen 80;
server_name localhost;location / { root D:/Github/Server/advanced; index index.php index.html index.htm; #开启rewirte if (!-e $request_filename){ rewrite ^/(.*) /index.php?r=$1 last; }
Real solution,
Reply content:
Write an interface that uses the path to Localhost/api/web/index.php?r=user/test
Actiontest's code is echo ' 123 ';
According to the online tutorial, the Urlmanager is configured, the code is as follows
'urlManager' => [ 'enablePrettyUrl' => true, //美化url==ture 'enableStrictParsing' => false, //不启用严格解析 'showScriptName' => false, //隐藏index.php 'rules' => [ '
/'=>'
/', ], ],
Then the Nginx rewrite is configured.
Listen 80;
server_name localhost;location / { root D:/Github/Server/advanced; index index.php index.html index.htm; #开启rewirte if (!-e $request_filename){ rewrite ^/(.*) /index.php?r=$1 last; }
Real solution,