laravel5.2框架中倒入模版,但访问css文件有问题。根目录下的文件访问政策,可以获取css样式。但是到public目录下index.php入口,就无法获取css样式文件,但是html内容是正常的。通过访问源码的方式,点击css链接,出现报错NotfoundHttpException in RouteCollection.php这是什么问题?根目录下没有.htaccess文件但是public目录下有.htaccess文件有影响吗?
1 回答

长风秋雁
TA贡献1757条经验 获得超7个赞
什么环境?建议你看一下url重写相关的;
大概这样的:
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
添加回答
举报
0/150
提交
取消