Reputation: 15
I am using laravel 5.4, and I put all database details in .env file for connecting database, but unfortunately, this details can see my URL path, so what is the best solution for declare database details in Laravel, thank you this is the screen short of accessing .env file through URL
Upvotes: 0
Views: 62
Reputation: 356
You can control it access by htaccess.
<Files .env>
order allow,deny
Deny from all
</Files>
This will prevent the access of .env file from url. Place this into your root htaccess file. Thank you.
Upvotes: 2