how to configure apache to view hidden (`.`) files?

26,442

Solution 1

Somewhere you have an IndexIgnore directive (mods-enabled/autoindex.conf?) that adds dotfiles to the list of files to ignore (mine has .??*) . Once a pattern has been added to the ignore list, it can't be removed.

Solution 2

To amend DerfK's answer: in apache version 2.4 you can, in fact, reset IndexIgnore via a new directive, IndexIgnoreReset

Share:
26,442

Related videos on Youtube

Claudiu
Author by

Claudiu

Updated on September 17, 2022

Comments

  • Claudiu
    Claudiu almost 2 years

    How do I make a directory listing in apache show the ./hidden files? I tried both

        <Directory /var/www/*>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
    

    and

        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
    

    but neither show the hidden files

  • Emanuel Berg
    Emanuel Berg over 11 years
    Do you know, if this can be configured "locally", so to solve this problem?
  • DerfK
    DerfK over 11 years
    @EmanuelBerg the directive says it's valid in VirtualHost and .htaccess so it's possible to set it "locally" keeping in mind that you cannot unset filenames added at higher levels, so you'd need to completely remove global configuration.
  • Daniel Sokolowski
    Daniel Sokolowski over 11 years
    To be able to list .htaccess .htpasswd files you also have to add explicit listing using the <Files> directive; see /etc/apache2/apache2.conf where these files are set to be hidden: ' <Files ~ "^\.ht"> Order allow,deny Allow from all Satisfy all </Files>'