讓apache顯示目錄列表的配置方法
1、apache中顯示目錄列表
在http.conf中加入如下代碼(如有虛擬主機配置,加在虛擬主機配置段內(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、訪問虛擬目錄時可用"http://ip/alias"的形式,也可把主目錄內(nèi)的index.php或index.html文件用如下代碼代替,實現(xiàn)用"http://ip"即可自動跳轉(zhuǎn)到指定的虛擬目錄,"("count()",60)"內(nèi)的60表示跳轉(zhuǎn)倒計時為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 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.dbjr.com.cn";}
}</script>
</p>
</form>
</body>
</html>
- Apache 虛擬目錄和默認首頁的設(shè)置
- Apache Rewrite實現(xiàn)URL的301跳轉(zhuǎn)和域名跳轉(zhuǎn)
- windows中apache 301頁面跳轉(zhuǎn)實現(xiàn)方法
- apache設(shè)置自動將http跳轉(zhuǎn)到https的方法
- 禁止apache顯示目錄索引的常見方法(apache禁止列目錄)
- Apache mod_rewrite實現(xiàn)HTTP和HTTPS重定向跳轉(zhuǎn)
- Apache中使非偽靜態(tài)url跳轉(zhuǎn)到偽靜態(tài)url的方法
- Apache中解決動態(tài)地址跳轉(zhuǎn)死循環(huán)的方法
- Apache的Rewrite設(shè)置多域名301跳轉(zhuǎn)到主域名的方法
- Apache無法自動跳轉(zhuǎn)卻顯示目錄的解決方法
相關(guān)文章
Linux中怎么通過PID號找到對應(yīng)的進程名及所在目錄方法
本篇文章主要介紹了Linux中怎么通過PID號找到對應(yīng)的進程名及所在目錄方法,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2018-06-06Linux下用netstat查看網(wǎng)絡(luò)狀態(tài)、端口狀態(tài)
這篇文章主要介紹了Linux下用netstat查看網(wǎng)絡(luò)狀態(tài)、端口狀態(tài)的相關(guān)資料,非常不錯,具有參考借鑒價值,需要的朋友可以參考下2016-12-12Linux如何使用libudev獲取USB設(shè)備VID及PID
這篇文章主要介紹了Linux如何使用libudev獲取USB設(shè)備VID及PID,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友可以參考下2020-09-09Linux下php連接SQLServer 2000數(shù)據(jù)庫的配置方法
Linux服務(wù)器中的php程序能夠連接到Windows服務(wù)器中的SQL Server 2000數(shù)據(jù)庫,這里分享下配置方法,需要的朋友可以參考下2013-06-06