How to hide config files from direct access?

后端 未结 9 2071
野性不改
野性不改 2020-11-22 14:46

I am using Laravel for web app. Uploaded everything on production and found out that some of the files can be directly accessed by url - for example http://example.com/compo

9条回答
  •  渐次进展
    2020-11-22 15:09

    That is incorrect. composer.json sits outside of the public directory and therefore should not be accessible. This means that your VirtualHost configuration is incorrect.

    Please make sure that your path to your directory ends with /public.

提交回复
热议问题