Skip to content

All topics  /  Laravel

How to stop .env open from URL in laravel?

Laravel ·

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>