BH空间不显示目录的方法
bluehost又称BH,默认情况下bh空间会显示目录索引,如何让bh空间不显示目录列表呢?
下面是禁止显示目录列表的方法和步骤:
我们都知道在linux里面可以通过.htaccess干什么事情,我们可以将.htaccess文件放在与public_html并列的地方
.htaccess中的内容为Options -Indexes,则public_html中所有的站点都不显示目录列表了
以上方法已经验证--cql
其他解释:
进入cpanel,点 索引管理区 (在页面靠下的位置)
会出现如下提示:
索引管理器
通过索引管理器你可以定制在网络上查看目录的方式。 你可以选择默认样式、无索引,或者两种索引类型。 如果不希望别人查看到你目录中的文件,则选择无索引。
请单击文件夹名选择你想要保护的文件夹。 你可以在图标上单击来选择。
注意:如果将根目录选择 无索引 访问根目录下的任何网站和任何文件或目录,均会出现下面的提示:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@zhangskjkll.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
--------------------------------------------------------------------------------
Apache Server at www.panpan.org Port 80
所以这个地方要灵活处理,如果不幸出现了上面的错误提示,要记得修改.htaccess就行了