Laravel公用文件夹

编程入门 行业动态 更新时间:2024-10-28 14:22:29
本文介绍了Laravel公用文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想知道是否有人可以阐明为什么laravel应用程序的index.php文件位于公共目录中.如果我改为将其移动到根目录中,会有什么风险?

I was wondering if someone could shed some light as to why the index.php file for a laravel application lives in the public directory. What are the risks if I were to move it into the root directory instead?

推荐答案

laravels公用文件夹中的文件和文件夹可以通过Web访问.为了安全起见,laravel框架中的所有其他文件和文件夹都不应通过网络访问.

The files and folders in laravels public folder are meant to be web accessible. For security, all other files and folders in the laravel framework should not be web accessible.

将index.php移至laravels根目录将破坏框架并违反最佳实践.

Moving the index.php to laravels root will break the framework and defy best practices.

按照这些说明进行操作,以确保您的服务器配置指向DocumentRoot的公共目录

Follow these instructions to ensure your servers config points to the public directory for DocumentRoot

更多推荐

Laravel公用文件夹

本文发布于:2023-07-12 07:23:02,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1096843.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件夹   Laravel

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!