2020-02-12 17:34:04

Hi all,
I was wondering if anyone could tell me how you make a listing of directories on a website (either an entire directory or some files).
An example of this would be on Mason's website where all his projects are just there and you can click download (that's probably just without an index file since it seems that way) or Grossgang which has some info about himself and then the listing of folders and files.
Thanks all!

2020-02-12 18:59:38

Delete index.htm or index.html. If you use php, remove index.php

Ivan M. Soto.
Feel free to check out my work and services.
http://ims-productions.com

2020-02-12 19:03:51

My server just gives a 403 when I try to do that.

2020-02-13 00:56:56

Hello.

If .htaccess is available, you can display a list of files in the directory by writing the following in .htaccess.
Note that this method is only available if you use Apache as the server software.

options +Indexes

2020-02-23 01:42:49

Hi,
It can be done through coding too.
You could have a PHP file listing what is on the specified directory if you need.

Co-founder of Sonorous Arts.
Check out Sonorous Arts on GitHub: https://github.com/sonorous-arts/

2020-02-23 01:53:56

You shouldn't do this through coding.  That's both harder and less secure than it needs to be. Both Apache and Nginx have configurations for this.  I don't know how to turn Apache's on, but Nginxs info is here: http://nginx.org/en/docs/http/ngx_http_ … odule.html

My Blog
Twitter: @ajhicks1992

2020-02-23 14:58:00

camlorn wrote:

You shouldn't do this through coding.  That's both harder and less secure than it needs to be. Both Apache and Nginx have configurations for this.  I don't know how to turn Apache's on, but Nginxs info is here: http://nginx.org/en/docs/http/ngx_http_ … odule.html

Can't agree with it being harder, But yes it's not a secure way to do such a thing.
Just mentioned it as a possibility. The secure way is to enable the index through web server.

Co-founder of Sonorous Arts.
Check out Sonorous Arts on GitHub: https://github.com/sonorous-arts/

2020-02-23 16:06:04

I'm going to point out that with respect to difficulty, we're talking about enabling one line in your web server's configuration vs getting the PHP config right, then writing a PHP script to enumerate the directory.  Perhaps you don't have access to the web server's configuration, in which case the coding might be worth it, but otherwise one of these is clearly easier.

Then I'm going to leave the discussion because this stands alone and anything else I might say on this topic would be redundant.

My Blog
Twitter: @ajhicks1992

2020-02-24 16:57:13

at1, by not putting index page on you're web