让apache显示目录列表的配置方法

时间:2022-02-20 21:13:18 

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 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 = "https://www.jb51.net";}
}</script>
</p>
</form>
</body>
</html>

标签:目录列表
0
投稿

猜你喜欢

  • 泛搜索时代,网站应该更擅长搜索

    2009-10-06 14:16:00
  • Gravatar是什么?全球通用头像简单介绍与使用教程

    2011-04-22 13:05:00
  • Google限定AdSense广告中可点击的区域

    2007-11-15 12:20:00
  • 网站排名与网站收录毫无关系

    2008-08-19 12:58:00
  • FckEditor安装配置使用中文教程

    2007-11-10 19:06:00
  • 百度联合娃哈哈慈善基金会 邀网友许爱心梦想

    2009-10-30 09:51:00
  • Apache访问出现501 Method Not Implemented错误解决

    2023-10-09 21:14:32
  • Vmware虚拟机安装Ubuntu 16.04 LTS(长期支持)版本+VMware tools安装的图文教程

    2021-09-01 05:28:17
  • 谈谈中国人做英文站的优势和劣势

    2008-11-24 16:22:00
  • linux更改目录显示颜色实例详解

    2023-11-02 14:32:57
  • 二十个搜索引擎优化常见问题解答

    2009-01-12 15:24:00
  • 教你如何查看要注册的域名有过不良记录

    2008-11-16 18:52:00
  • 链接诱饵案例 从一个留言插件引发的思考

    2009-02-19 10:20:00
  • 加强企业Linux系统安全的若干方法

    2009-07-21 09:46:00
  • 避免Adsense帐号被锁定的技巧

    2007-10-02 20:01:00
  • GoDaddy:如何使用File Manager上传文件

    2010-05-01 12:53:00
  • 让DNS服务器支持泛域名解析

    2009-01-22 16:00:00
  • 详解Ubuntu16.04下Hadoop 2.7.3的安装与配置

    2023-11-04 09:13:03
  • SNS流行应用动感相册 为网友提供精彩FLASH内容

    2009-02-15 09:41:00
  • 竞合将是未来中国网络视频产业的主旋律之一

    2009-10-16 09:23:00
  • asp之家 网站运营 m.aspxhome.com