您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

yii2配置urlmanager无效

2024/4/15 23:39:32发布22次查看
写了一个接口,使用路径为localhost/api/web/index.php?r=user/test
actiontest的代码就是echo '123';
根据网上的教程,配置了urlmanager,代码如下
'urlmanager' => [ 'enableprettyurl' => true, //美化url==ture 'enablestrictparsing' => false, //不启用严格解析 'showscriptname' => false, //隐藏index.php 'rules' => [ '/'=>'/', ], ],

然后配置了nginx的rewrite
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; }

真心求解,
回复内容: 写了一个接口,使用路径为localhost/api/web/index.php?r=user/test
actiontest的代码就是echo '123';
根据网上的教程,配置了urlmanager,代码如下
'urlmanager' => [ 'enableprettyurl' => true, //美化url==ture 'enablestrictparsing' => false, //不启用严格解析 'showscriptname' => false, //隐藏index.php 'rules' => [ '/'=>'/', ], ],

然后配置了nginx的rewrite
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; }

真心求解,
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product