magento2 为什么有两个可能的根目录(Why Magento 2 have 2 possible root folder?)
来源:互联网 发布:vb多肽公司 编辑:程序博客网 时间:2024/06/06 08:28
Magento 2 have 2 possible root folder:
magent2 有两个可能的根目录
/path/to/magento2/index.php
/path/to/magento2/pub/index.php
One is at the absolute top level of Magento 2’s distribution folder. The second is inside the “pub” folder.
一个在magneto2项目的根目录下,另一个在pub文件夹下
If I set base URL is either of them, magento is working perfectly.
如果我使用两个中的任意一个设置为base URL,magento都可以很完美的工作/运行。
Can anyone explain me why Magento 2 using 2 root folder like that ?
那有谁可以帮我解释一下:为什么magento 有两个根目录文件夹呢?
--------------------------------------------
Using /pub is better, because it is more secure. Why? Because in that case most of Magento's code will live outside the public document root, so the possible attack surface is smaller. In other words, when you use the top level folder as document root, you have to make sure that various folders (such as app) are explicitly denied in your webserver configuration.
That said, not everybody can configure the document root, so Magento provided a top level index.php for compatibility.
That said, not everybody can configure the document root, so Magento provided a top level index.php for compatibility.
使用/pub文件夹下的index.php 更好。因为他更加安全。为什么?因为这种情况下,大部分的magento代码都将在公共的根目录以外运行,所以也减少了受到攻击的可能性。
换而言之,当你使用最高层的文件夹作为文件根目录的话,你必须确定各种文件夹(比如app文件夹)确实是在你的web服务器的配置里被拒绝访问了的。
也就是说,并不是每一个人都会(正确)配置项目的文件根目录,所以为了通用性,magento提供了一个顶层的index.php。
翻译的不好请多谅解。
0 0
- magento2 为什么有两个可能的根目录(Why Magento 2 have 2 possible root folder?)
- Warning: Your Magento folder does not have sufficient write permissions.
- 【magento2命令行安装 WINDOWS】Magento 2 Design Theme tab 没有找到
- Magento Connect: “Warning: Your Magento folder does not have sufficient write permissions.”
- Magento Connect: “Warning: Your Magento folder does not have sufficient write permissions.”
- [magento]Warning: Your Magento folder does not have sufficient write permissions. If you wish to pro
- 2. Magento2 --- (2) theme --- structure
- How to Run Magento 2 using pub/index.php file(怎么将magento2默认首页改到index.php)
- Magento2介绍, magento新版本解读
- 判断两个单链表是否相交(链表中可能有环的情况下)
- java 修改web-root folder 的值
- MyEclipse2014修改Web-root folder的值
- (2)入门指南——(3)为什么jquery工作的很好(Why jQuery works well)
- 判断两个单链表(可能有环)是否相交
- root 是什么?为什么会有 Root 账户?
- root根目录修改后的PS1恢复
- why have two heartbeat?
- 为什么新生代有两个survivor?
- NSURLSessionDownloadTask的深度断点续传
- android 开发 an internal error encountered
- SQL表连接查询(inner join、full join、left join、right join)
- 开篇
- 119. Pascal's Triangle II
- magento2 为什么有两个可能的根目录(Why Magento 2 have 2 possible root folder?)
- QT多界面随意跳转,不闪烁
- PHP中对像比较,比较操作符和全等操作符的区别
- 请放下手机,就一会儿……
- javascript的简单等待跳转模型
- linux命令 mv
- shell awk转成数组
- 糖果机器人_0003_day2_Noon
- DOM 和 jQuery对象相互转换 以及for-in和$.each遍历方法