Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.ENV file is visible

Tags:

I am using Laravel 5.1

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?

like image 530
smartrahat Avatar asked Oct 11 '15 19:10

smartrahat


1 Answers

Finally I hide .env and disable index view of the folder named local. I create a .htaccess in folder local.

And here is the code of .htaccess

# Disable index view
Options -Indexes

# Hide a specific file
<Files .env>
    Order allow,deny
    Deny from all
</Files>
like image 175
smartrahat Avatar answered Oct 12 '22 21:10

smartrahat