7

My site is written in asp.net using mono and apache under ubuntu LTS.

After debugging most of the problems out I still had problems with my icon folder icons. It was giving me the wrong or no icon. Then I notice /blah gets me my custom 404 page while /icons gets me a directory listing.

Why is /icons/ path hitting a directory instead of using my asp.net code? No other path that I know of (ATM) does that.

Side note: /images/ also exist in the same directory as my icons folder. /images/ does not cause a directory listing either.

masegaloeh
  • 18,498

2 Answers2

14

Apache2 comes out of the box with an alias mod file enabled at this location:

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

and this is the content of that file

<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>

So you can remove the sym link at

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

to disable the behavior.

steampowered
  • 655
  • 2
  • 11
  • 25
5

in your httpd.conf you have something like

Alias /icons /path/to/icon/dir
Mike
  • 22,748