disable access to included files

前端 未结 3 554
臣服心动
臣服心动 2021-01-22 18:59

i have a litte question..

i want to disable the direct access to my included files. (example header.tpl.php, footer.tpl.php, confic.inc.php, db-connect.inc.php ect.)

3条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-22 19:26

    Why not just tuck it above the public_html folder or whatever you use as the default html folder and include with ../../. Then it would be available to scripts but the public would get a default 404/ file not found. I do this with config files that hold passwords and such so no one public can access them.

提交回复
热议问题