Forum Moderators: phranque

Message Too Old, No Replies

Deny all files allow only a few.

Deny all files allow only a few.

         

hyoung_cccs

12:23 am on Nov 10, 2006 (gmt 0)

10+ Year Member



What would be the best way inside httpd.conf to allow an index of files in a directory where there is only one file type shown.

As an example if you did ls you would see:

crpg07in_151284.xml
crpg07in_151286.xml
fpapord_150954.lis
fpapord_150954.log
fpapord_150954.shl
fzrainv_12761.lis
fzrainv_12761.log

But from a browser you would see:

fpapord_150954.log
fzrainv_12761.log

Thank you in advance for any thoughts you might share

jdMorgan

12:36 am on Nov 10, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This doesn't seem to be the usual usage of the phrase "deny files." It seems like you simply want to restrict listing of files in directory indexes, not deny access to them.

Perhaps an IndexIgnore [httpd.apache.org] directive, optionally enclosed in a <Directory [httpd.apache.org]> container...

Jim

[edited by: jdMorgan at 12:36 am (utc) on Nov. 10, 2006]

hyoung_cccs

6:57 pm on Nov 10, 2006 (gmt 0)

10+ Year Member



Jim

First off thank you for your response, that looks like the directive I was searching for. However I wanted to avoid the need to supply a list to filter because the application may produce a new file type that is not in the list and therefore will not be filtered even though it will need to be. I was hoping there might be an option, or combination of options, that says “Show only these files”.

Heath

jdMorgan

2:25 pm on Nov 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It sounds like you need to write a script (using PERL or PHP, perhaps) to display the directory in whatever way you wish. Having done so, you can set DirectoryIndex to point to the script, and it will then produce your custom directory listing page.

Jim

hyoung_cccs

4:30 pm on Nov 13, 2006 (gmt 0)

10+ Year Member



I was trying to avoid that, but thank you for your assitance. Look's like it is time to break out the O'Reilly books.

Heath