How to protect .env file in Laravel

后端 未结 6 1003
甜味超标
甜味超标 2021-01-11 11:30

I moved my project to HOST but I can still access .env with address mysite.com/.env and display this file with all variables and secure data. my .env file :

         


        
6条回答
  •  甜味超标
    2021-01-11 11:50

    Create .htaccess file in your Root Directory and put following Code.

    #Disable index view
    options -Indexes
    
    #hide a Specifuc File
    
    
    order allow,deny
    Deny from all
    
    

提交回复
热议问题