I have the following directory structure on my Apache web root.
I would like to res开发者_运维知识库trict 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
this will remove permissions for the outside world to the directory source and all of its content
You can also put an index.html file in each directory with a forbidden access notice as index.html is the default default file to be viewed when opening a directory.
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");
?>
精彩评论