Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache 如何防止使用httpd.conf从客户端浏览器访问服务器中的某些文件_Apache - Fatal编程技术网

Apache 如何防止使用httpd.conf从客户端浏览器访问服务器中的某些文件

Apache 如何防止使用httpd.conf从客户端浏览器访问服务器中的某些文件,apache,Apache,我有一些文件的扩展名:sample.txt、.js、.html和self指定的扩展名。我想拒绝访问Apache web服务器上的这些文件。拒绝访问意味着,现在当我将文件名和URL一起放在浏览器上,并且文件正在浏览器上显示时,我可以访问这些文件。我不想在浏览器上显示它 亲爱的下层选民,谦虚的请求,问题可能会有澄清问题,无论何时,请评论原因 在httpd.conf中添加以下内容 <FilesMatch "\.js"> Order allow,deny Deny from all Sati

我有一些文件的扩展名:sample.txt、.js、.html和self指定的扩展名。我想拒绝访问Apache web服务器上的这些文件。拒绝访问意味着,现在当我将文件名和URL一起放在浏览器上,并且文件正在浏览器上显示时,我可以访问这些文件。我不想在浏览器上显示它


亲爱的下层选民,谦虚的请求,问题可能会有澄清问题,无论何时,请评论原因

在httpd.conf中添加以下内容

<FilesMatch "\.js">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>

命令允许,拒绝
全盘否定
满足所有
根据上面js、txt等文件扩展名的变化,这很有帮助