找到apache的配置文件httpd.conf,添加<Directory "指定DIR"> <FilesMatch ".(php|asp|jsp)$"> Deny from all </FilesMatch> </Directory>