Now a lot of permission system is based on URL path Control (module/action) such as thinkphp, Access path is http://localhost/thinkphp/index.php/index/index but according to the file path can also access to such as HTTP ://localhost/thinkphp/tpl/index/index.html, directly shows the source of index.html! There is no resolution, how to prohibit access to it? or other protective measures.
Reply content:
Now a lot of permission system is based on URL path Control (module/action) such as thinkphp, Access path is http://localhost/thinkphp/index.php/index/index but according to the file path can also access to such as HTTP ://localhost/thinkphp/tpl/index/index.html, directly shows the source of index.html! There is no resolution, how to prohibit access to it? or other protective measures.
Put it outside the web directory
Http://doc.thinkphp.cn/manual/deploy_directory.html
Create a new public folder and place the portal file in public
If you have a upload or images folder, you should also put it under Puclib.
Then modify the directory definition in the portal file
// 定义应用目录define('APP_PATH','../Application/');// 引入ThinkPHP入口文件require '../ThinkPHP/ThinkPHP.php';