apache下禁止某个目录访问php文件
<IfModule mod_rewrite.c> RewriteEngine on RewriteCond % !^$ RewriteRule ./(.*).(php|php1|php2|php3|php4|php5|php6|php7|php8)$ – [F] </IfModule> |
在uploads文件夹下放置一个.htaccess文件,如果在访问uploads文件夹下的目录里以php后缀的文件,则提示:
Forbidden You don't have permission to access /uploads/20190614/phpinfo.php on this server. Apache Server at 47.110.149.115 Port 80 |
参考链接
https://blog.csdn.net/qq_32606647/article/details/70046049