简体   繁体   中英

Folder Access Restrictions Apache

I have the following directory structure on my Apache web root.

I would like to restrict the "source" folder to the outside world. Currently it can be accessed via its url.

How can this be done?

索引页

Put a .htaccess file inside the source folder:

order allow deny
deny from all
chmod -R o-rwx source

这将删除外界对目录源及其所有内容的许可

您也可以在每个目录中放置一个index.html文件,并带有禁止访问的通知,因为index.html是打开目录时要查看的默认默认文件。

You could make it seem like the directory doesn't exist by inserting index.php and writing

<?php
  header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
?>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM