Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/asp.net-mvc-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Yii2中的路由抛出404错误_Yii2 - Fatal编程技术网

Yii2中的路由抛出404错误

Yii2中的路由抛出404错误,yii2,Yii2,以下路由规则在WINDOWS/XAMPP(Apache)下运行良好,但在LINUX(nginx)下由于抛出404-Error而失败。在Yi2中定义这两个操作系统的规则有什么区别 “urlManager”=>[ 'class'=>'yii\web\UrlManager', “enablePrettyUrl”=>true, 'showScriptName'=>true, 'enableStrictParsing'=>true, “规则”=>[ “/”=>“站点/登录”, “重置”=>“站点/请求密

以下路由规则在WINDOWS/XAMPP(Apache)下运行良好,但在LINUX(nginx)下由于抛出404-Error而失败。在Yi2中定义这两个操作系统的规则有什么区别

“urlManager”=>[
'class'=>'yii\web\UrlManager',
“enablePrettyUrl”=>true,
'showScriptName'=>true,
'enableStrictParsing'=>true,
“规则”=>[
“/”=>“站点/登录”,
“重置”=>“站点/请求密码重置”,
'关于'=>'站点/索引',
“联系人”=>“站点/联系人”,
“注销”=>“站点/注销”,
“注册”=>“站点/注册”,
'公式'=>'站点/脚本',
“praktikum”=>“bewerbungen/index”,
“/”=>“/视图”,
'//' => '/',
“国家”=>“国家/指数”
],
],
.
.

.
使用
vhost
配置文件更新您的问题。我的应用程序中没有vhost配置文件,只有配置文件main-local.php,但它在nginx中,可能在
/etc/nginx/sites available/{这里是您的vhost配置}