Is there a way to modify the style of the "Index of" page of a server?

0


For example, when accessing the root of a directory that contains or not files and more directories. I have searched for CSS but I have not seen anything. Any ideas? Is it even possible?

Thanks

    
asked by jfalava 05.11.2018 в 00:12
source

1 answer

0

This tutorial can help you a lot link details on how to modify it in Apache.

Very briefly, if you would like to add existing Apache features to the directory browser you will have to modify the IndexOptions directive, the full list of options is here: link

An example is the following:

# COLOCAR INDEX OPTIONS
IndexOptions IgnoreCase FancyIndexing FoldersFirst

FancyIndexing - Displays additional file information.

IgnoreCase - Sort alphabetically regardless of case.

FoldersFirst - (This option only takes effect if FancyIndexing is enabled) It shows first the subdirectories and then the files that are in the directory.

And there are many more that you can use, now we will customize the HTML code to your liking. First you must know that there are 3 modules that make up that page:

  • The Header - by default is automatically generated by Apache.
  • Directory listing - Apache necessarily generates it, it can not be modified.
  • The Footer - also called as "Readme".

Fortunately Apache allows you to overwrite the path of the header and footer file, which you can modify with your html code. You must add the following code to the .htaccess file (remember to have this enabled in the configuration):

# SPECIFY HEADER FILE
HeaderName header.html

# SPECIFY FOOTER FILE
ReadmeName footer.html

And in each directory you must place the files header.html and footer.html. And so that they do not show up in the list you should add the following to the Apache configuration or editing the .htaccess file:

# Ignorará los archivos en el listado del directorio
IndexIgnore header.html footer.html

The rest is included in the guide is simply edit that and you can customize it, although not totally, but if for the most part.

    
answered by 05.11.2018 в 00:34