智能财务分析中的因果推断模型实践与架构设计
2026/10/28 19:36:17
仅限于阿帕奇服务器的情况,把项目的public文件夹里的.htaccess文件,替换为下面的内容,就禁止了外部访问,公共文件夹里的这些.php文件的执行了。就是黑客上传上来php执行文件后,黑客不可以通过公共的这个路径地址,再浏览器里执行这个文件。但是不可以避免在服务器内部执行这些文件,这种就再想其他办法
<IfModule mod_rewrite.c>RewriteEngine On #防 xxx.php.xxx 绕过 RewriteRule^(uploads|upfiles|hetong|ueditor)/.*\.php\.-[R=403,L]#拦截脚本后缀,兼容php、php3~php9、phtml RewriteRule^(uploads|upfiles|hetong|ueditor)/.*\.(ph(p[0-9]?|tml)|pht|phar|inc|asp|aspx|jsp|sh|cgi|pl|py)$-[R=403,L]#上传目录截断,不进TP路由 RewriteRule^(uploads|upfiles|hetong|ueditor)/-[L]#TP路由RewriteCond%{REQUEST_FILENAME}!-d RewriteCond%{REQUEST_FILENAME}!-f RewriteRule^(.*)$ index.php?s=$1[QSA,PT,L]</IfModule>#<IfModule mod_rewrite.c>#RewriteEngine On#RewriteBase/#RewriteRule^index\.php$-[L]#RewriteCond%{ENV:REDIRECT_STATUS}^$#RewriteCond%{REQUEST_FILENAME}!-f#RewriteCond%{REQUEST_FILENAME}!-d#RewriteRule./index.php[L]#</IfModule>