How to show the whole file name while using .htaccess to list files in a directory?

My .htaccess file looks like this :

Options +Indexes

When I look at the directory from my browser, it looks like this:

enter image description here

File names that are too long are truncated, how can I make it show the whole file name?


Solution 1:

Easy! Just use the Apache IndexOptions directive in addition to Options +Indexes in the .htaccess file.

In your case this would be simple enough to show the full names of files:

Options +Indexes
<IfModule mod_autoindex.c>
  IndexOptions NameWidth=*
</ifModule>

The key for you is the NameWidth value which when set to a wildcard value of * will show the full length of the file and directory names.

This site has some great examples on how to better customize and style your directory listings with IndexOptions. Ditto with this site’s examples as well.