如何通过URL操作避免文件夹导航 [英] How to avoid Navigation of folders through URL manipulation
本文介绍了如何通过URL操作避免文件夹导航的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请我在我的网站(测试阶段)上需要您的帮助.我有一个具有这种性质的文件系统...
Please i need your help with my website (testing stage). I have a file system of this nature...
www (root)
{
school { //main project folder
images //images folder
uploads //user uploads folder
JavaScripts //JS folder
CSS // css folder
includes //includes folder
index.php
contactus.php
aboutus.php
register.php
} //main project folder
} //www folder
当用户这样做时,如何防止用户浏览我的文件夹系统:
how can i prevent users from browsing through my folder system when they do somrthing like these:
http://127.0.0.1/school/css
http://127.0.0.1/school/images
http://127.0.0.1/school/includes
http://127.0.0.1/school/uploads
http://127.0.0.1/school/javascripts
感谢您的帮助....
推荐答案
See the following article on how to disable direct directory browsing
具体来说,请在您的.htaccess文件中搜索 Options Indexes
.如果不存在,请将以下行添加到您的.htaccess文件中:
Specifically, search for Options Indexes
in your .htaccess file. If one does not exist, add the following line to your .htaccess:
Options -Indexes
目录浏览不可用.
以上文章提供了更多方法.
More methods are available at the article above.
这篇关于如何通过URL操作避免文件夹导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文