让apache服务器显示文件,让apache显示目录列表的配置方法

1、apache中显示目录列表在http.conf中加入如下代码(如有虚拟主机配置,加在虚拟主机配置段内),并把主目录内的index.pho,index.html,index.htm文件删除

Alias /download "/download"

Options Indexes

Order allow,deny

IndexOptions Charset=UTF-8

Allow from all

其中“/download”是要显示文件列表的目录,参数"Options Indexes"表示启用目录浏览,"IndexOptions Charset=UTF-8"设置字符集,以消除中文乱码。

2、访问虚拟目录时可用"http://ip/alias"的形式,也可把主目录内的index.php或index.html文件用如下代码代替,实现用"http://ip"即可自动跳转到指定的虚拟目录,"("count()",60)"内的60表示跳转倒计时为60ms。

正在进入

正在进入,请稍等......

var bar=0

var line="||"

var amount="||"

count()

function count(){

bar=bar+2

amount =amount + line

document.loading.chart.value=amount

document.loading.percent.value=bar+"%"

if (bar<99)

{setTimeout("count()",60);}

else

{

window.location = "http://www.jb51.net";}

}

你可能感兴趣的:(让apache服务器显示文件)