ThinkPHP protects the template file core prompt: because the template file may leak the field information of the data table, there are two ways to protect your template file from being accessed: The first way is to configure. the htaccess file and ThinkPHP protect the Template File. for the Apache server, save the following code in the template directory of the project (Tpl by default) and save it. htaccess. in this way, the entire project directory cannot be accessed directly, because the ThinkPHP template protects the template file.
Core tip: because the fields in the data table may be leaked in the template file, there are two ways to protect your template file from being accessed: The first method is configuration. the htaccess file and ThinkPHP protect the Template File. for the Apache server, save the following code in the template directory of the project (Tpl by default) and save it. htaccess. in this way, the entire project directory cannot be accessed directly, because the field information of the data table may be leaked in the template file. There are two ways to protect your template file from being accessed:
The first method is to configure the. htaccess file for the Apache server.
Save the following code in the template directory of the project (Tpl by default) as. htaccess.
Order Allow, Deny
Deny from all
If your template file suffix is not html, you can change *. html to the suffix of your template file.
The second method is for independent servers and is not suitable for VM users.
Deploy the project directory outside the WEB Directory of the website according to the website security deployment solution we mentioned earlier. in this way, the entire project directory cannot be accessed directly, and the template file is also protected.