1、apache中顯示目錄列表
在http.conf中加入如下代碼(如有虛擬主機配置,加在虛擬主機配置段內),并把主目錄內的index.pho,index.html,index.htm文件刪除
復制代碼 代碼如下:
Alias /download "/download"
<Directory "/download">
Options Indexes
Order allow,deny
IndexOptions Charset=UTF-8
Allow from all
</Directory>
其中“/download”是要顯示文件列表的目錄,參數"Options Indexes"表示啟用目錄瀏覽,"IndexOptions Charset=UTF-8"設置字符集,以消除中文亂碼。
2、訪問虛擬目錄時可用"http://ip/alias"的形式,也可把主目錄內的index.php或index.html文件用如下代碼代替,實現用"http://ip"即可自動跳轉到指定的虛擬目錄,"("count()",60)"內的60表示跳轉倒計時為60ms。
復制代碼 代碼如下:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html">
<title>正在進入</title>
</head>
<body>
<form name=loading>
<p align=center> <font color="#0066ff" size="5">正在進入,請稍等</font><font color="#0066ff" size="5" face="Arial">......</font>
<input type=text name=chart size=46>
<input type=text name=percent size=47>
<script>
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.49028c.com";}
}</script>
</p>
</form>
</body>
</html>
新聞熱點
疑難解答