Apache2和/图标path行为不同

我的网站是在ubuntu LTS下使用mono和apache在asp.net中编写的。

在debugging大部分问题后,我的图标文件夹icons仍然存在问题。 这是给我错误的或没有图标。 然后我通知/blah给我我的自定义404页面,而/icons得到我的目录列表。

为什么是/icons/path击中目录,而不是使用我的asp.net代码? 我所知道的没有其他path(ATM)这样做。

附注: /images/也存在于我的图标文件夹相同的目录中。 /images/不会导致目录列表。

在你的httpd.conf中你有类似的东西

 Alias /icons /path/to/icon/dir 

Apache2在这个位置启用了一个别名mod文件,

 /etc/apache2/mods-available/alias.conf 

这是该文件的内容

 <IfModule alias_module> # Aliases: Add here as many aliases as you need (with no limit). The format is # Alias fakename realname # # Note that if you include a trailing / on fakename then the server will # require it to be present in the URL. So "/icons" isn't aliased in this # example, only "/icons/". If the fakename is slash-terminated, then the # realname must also be slash terminated, and if the fakename omits the # trailing slash, the realname must also omit it. # # We include the /icons/ alias for FancyIndexed directory listings. If # you do not use FancyIndexing, you may comment this out. Alias /icons/ "/usr/share/apache2/icons/" <Directory "/usr/share/apache2/icons"> Options FollowSymlinks AllowOverride None Require all granted </Directory> </IfModule> 

所以你可以删除sym链接

 /etc/apache2/mods-enabled/alias.conf 

禁用行为。