首页 > 技术文章 > wamp不显示文件图标

scale 2017-04-10 14:02 原文

wamp不显示文件图标

效果如下图

  • 右键图片“在新的标签页打开图片”后会跳转到404页面,并显示The requested URL /icons/unknown.gif was not found on this server.

解决方案

  • 去掉httpd.conf文件中Include conf/extra/httpd-autoindex.conf前面的'#'

  • 配置wamp\bin\apache\apache2.4.9\conf\extra目录里httpd-autoindex.conf文件

  • 将文件中下面模块

  Alias /icons/ "c:/Apache24/icons/"

  <Directory "c:/Apache24/icons">
     Options Indexes MultiViews
     AllowOverride None
     Require all granted
  </Directory>

修改为:

  Alias /icons/ "icons/"

  <Directory "icons">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
  </Directory>
  • 重启apache所有服务Restart All Services

配置后文件图标正常,如下

  • 右键图片“在新的标签页打开图片”,会正常显示图片

推荐阅读