php - Secure Laravel website hosting -


i developed website using laravel , on web hoster have not find public directory , changed server.php
from

require_once __dir__.'/public/index.php'; 

to

require_once __dir__.'/index.php'; 

and moved contents of public folder in root , website works problem when put example http://mywebsite.com/.env can show content of .env site not protected.

the question :

how can protect files , directories ?

example of structure want:

index.php .htaccess favicon.ico img/ css/ js/ laravel/       app/       bootstrap/       database/       config/       storage/      .env      server.php      ... 

content of root of site => public folder content

laravel directory => other directories , files

place in public folder , revert changes server.php. in top level directory add .htaccess file code below:

<ifmodule mod_rewrite.c>    rewriteengine on     rewriterule ^(.*)$ public/$1 [l] </ifmodule> 

Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -