.ENV file is visible

前端 未结 4 1392
再見小時候
再見小時候 2021-02-19 03:45

I am using Laravel 5.1

I recently uploaded my project in shared hosting. but when i browse http://siteAddress.com/local/.env my .env file is visible.

<
4条回答
  •  感动是毒
    2021-02-19 04:14

    Please create a .htaccess file where you have .env file and write the code as shown below:

    # STRONG HTACCESS PROTECTION
    
     order allow,deny
     deny from all
     satisfy all
    
    

    Then try to hit the .env file from url and it will not be available and show codes inside.

    If you want to remove it from github.

    Please create new file .gitignore on the same directory.

    and add line

    .env
    

提交回复
热议问题