拒绝访问网站文件夹 [英] Deny access to website folders
问题描述
我看过几个网站:例如
http://www.website。 com / images / pic001.jpg
当我尝试访问 http:// www禁止.website.com / images / 。
这正是我想要好奇地保护我的文件夹的原因。
我该如何实现这一目标?
在中添加一些指令。 htaccess的?
更改文件夹权限?
谢谢,我希望我解释得很好,并且对我用英语写作的可怕方式感到抱歉
P.D .:我的网站托管在000webhost上。
Grettings!
I have seen several websites: for example http://www.website.com/images/pic001.jpg And when I try to access http://www.website.com/images/ is prohibited. That is exactly what I want to protect my folders from curious. How I can I accomplish this? Adding some instructions into the. htaccess? Changing Folder permissions? Thanks, I hope I explained well, and sorry for my horrible way of writing in English P.D.: My website is hosted on 000webhost. Grettings!
推荐答案
您可以添加选项-Indexes
插入到images文件夹中的.htaccess文件中,如果尝试访问/ images /,则会导致禁止消息,但仍然可以访问/images/pic001.jpg。
You can add Options -Indexes
into the .htaccess file in the images folder, this results in a forbidden message if one tries to access /images/, but access to /images/pic001.jpg is still possible.
更多信息请看这里: http://wiki.apache.org/httpd/DirectoryListings
这篇关于拒绝访问网站文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!