DEV Community

Discussion on: .env file in public folder is a security risk

Collapse
 
jrock2004 profile image
John Costanzo • Edited

If supported, I would use something like an htaccess file to protect that file

# Disable index view
Options -Indexes

# Hide a specific file
<Files .env>
    Order allow,deny
    Deny from all
</Files>