当使用Apache webserver时,我们在apache2.conf中有
AllowOverride All AllgrantedNginx webserver的替代方案是什么?
因为总是在Laravel中收到消息404
发布于 2019-10-30 22:44:29
AllowOverride是一条Apache指令,允许使用本地.htaccess文件,Laravel使用该文件为应用程序设置uri重写规则。Nginx不使用.htaccess文件,因此您必须将重写定义放入nginx站点文件中。
以下是我在Laravel应用程序中使用的重写规则
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
try_files $uri /index.php =404;
}https://stackoverflow.com/questions/58627836
复制相似问题