1、apache中顯示目錄列表
在http.conf中加入如下代碼(如有虛擬主機(jī)配置,加在虛擬主機(jī)配置段內(nèi)),并把主目錄內(nèi)的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”是要顯示文件列表的目錄,參數(shù)"Options Indexes"表示啟用目錄瀏覽,"IndexOptions Charset=UTF-8"設(shè)置字符集,以消除中文亂碼。
2、訪問虛擬目錄時(shí)可用"http://ip/alias"的形式,也可把主目錄內(nèi)的index.php或index.html文件用如下代碼代替,實(shí)現(xiàn)用"http://ip"即可自動(dòng)跳轉(zhuǎn)到指定的虛擬目錄,"("count()",60)"內(nèi)的60表示跳轉(zhuǎn)倒計(jì)時(shí)為60ms。
代碼如下:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html">
<title>正在進(jìn)入</title>
</head>
<body>
<form name=loading>
<p align=center> <font color="#0066ff" size="5">正在進(jìn)入,請(qǐng)稍等</font><font color="#0066ff" size="5" face="Arial">......</font>
<input type=text name=chart size=46 style="font-family:Arial; font-weight:bolder; color:#0066ff; background-color:#fef4d9; padding:0px; border-style:none;">
<input type=text name=percent size=47 style="color:#0066ff; text-align:center; border-width:medium; border-style:none;">
<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.companysz.com";}
}</script>
</p>
</form>
</body>
</html>
新聞熱點(diǎn)
疑難解答
圖片精選