Remove Last Modified and Size From mod_autoindex

924 Views Asked by At

I was working on a file storage page for my website, and I figured out how to do a lot of things so it using mod_autoindex for my apache server, and now I want to remove the Last Modified and Size field from the table.

If that could be done some way or another it would be great.

3

There are 3 best solutions below

0
Gabe Dunn On BEST ANSWER

I have found out that by injecting JS into the header/footer it would be easy to remove.

0
Jim K On

This can actually be done using only Apache directives. I'm very late answering this question, but I'm leaving this for future reference. This works for Apache v2.0+.

The required directives are:

<IfModule mod_autoindex.c>
  IndexOptions FancyIndexing
  IndexOptions SuppressLastModified
  IndexOptions SuppressSize
</IfModule>

The most convenient location for these directives is likely to be the .htaccess file in the directory you wish to style.

Note: The FancyIndexing option is required to enable the two Suppress options. They won't work without it.

Official Apache IndexOptions Documentation

0
Buddha_Peace On

You can use this in the httpd.conf to remove the last modified header in the response.

Header unset Last-Modified