How to stop .env open from URL in laravel?

Laravel

Nicesnippets

103

30-04-2020


Hello Guys,

Setup your laravel project in shared hosting then you have to secure you env file. at that time hide your env file from public folder. in env file we store very important data that's why disable env file from show. hide your .env file just put following code in .htaccess file

Put At Last In .htaccess File

<FilesMatch ".env">

Order allow,deny

Deny from all

</FilesMatch>

I hope it can help you...