文件夹访问限制 Apache
我的 Apache Web 根目录中有以下目录结构。
我想将“源”文件夹限制为外部世界。目前可以通过其 url 访问它。
这怎么能做到呢?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
将 .htaccess 文件放入源文件夹中:
Put a .htaccess file inside the source folder:
这将删除外界对目录源及其所有内容的权限
this will remove permissions for the outside world to the directory source and all of its content
您还可以在每个目录中放置一个带有禁止访问通知的index.html 文件,因为index.html 是打开目录时要查看的默认默认文件。
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.
您可以通过插入index.php并写入来使该目录看起来不存在
You could make it seem like the directory doesn't exist by inserting index.php and writing