.ENV文件是可见的 [英] .ENV file is visible
本文介绍了.ENV文件是可见的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Laravel 5.1
I am using Laravel 5.1
我最近在共享托管中上传了我的项目.但是当我浏览http://siteAddress.com/local/.env
时,我的.env文件是可见的.
I recently uploaded my project in shared hosting. but when i browse http://siteAddress.com/local/.env
my .env file is visible.
如果人们想使用文件夹视图浏览站点,是否可以隐藏此文件或重定向人们?
Is there any way to hide this file or redirect people if they want browse the site with folder view?
推荐答案
最后,我隐藏了.env
并禁用了名为local
的文件夹的索引视图.我在文件夹local
中创建一个.htaccess
.
Finally I hide .env
and disable index view of the folder named local
. I create a .htaccess
in folder local
.
这是.htaccess
# Disable index view
Options -Indexes
# Hide a specific file
<Files .env>
Order allow,deny
Deny from all
</Files>
这篇关于.ENV文件是可见的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文