Welcome to WebmasterWorld Guest from 107.20.110.201

Forum Moderators: phranque

Message Too Old, No Replies

Can you force a directory listing in a websites folder?

Instead of pulling up the index.* page?

     

Sootah

8:13 am on Apr 20, 2009 (gmt 0)

10+ Year Member



I have a directory on my webserver that I use to test out scripts or pages that I'm writing (usually in PHP). As there are a lot of files in this directory, and I almost always have at least one of them named index.php or .html I was curious if it's possible to force my web browser to display a directory listing as opposed to pulling up that directory's default page.

For instance, the /scripts directory on my server has several useful little things I've written but I cannot always remember the filename of what I'm looking for without having to FTP in to find out. Because I currently have an index.php file in this directory, it always pulls up. Sure, I could delete that file; but I'd prefer to know if there's a way to make the browser grab a directory listing when I tell it to. That'd come in handy all the time.

Is there a way in any of the browsers to do this? Let me know if clarification is required. I may not have explained what it is I'm trying to do very well. :)

Thanks in advance,

-Sootah

bill

8:30 am on Apr 20, 2009 (gmt 0)

WebmasterWorld Administrator bill is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



On most of my servers the setting for directory listing is in the control panel that the hosting company provides.

janharders

8:34 am on Apr 20, 2009 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



I think, putting

DirectoryIndex afilenamethatsurelydoesnotexist.nope
Options +Indexes

in an .htaccess in that directory should work. the server will look for that filename you gave as directoryindex, won't find it and serve the listing.

kaled

10:45 am on Apr 20, 2009 (gmt 0)

WebmasterWorld Senior Member kaled is a WebmasterWorld Top Contributor of All Time 10+ Year Member



> Is there a way in any of the browsers to do this?

No.

phranque

8:39 am on Apr 22, 2009 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



you can't do it in the browser - it is entirely a server configuration issue.

Sootah

9:09 am on Apr 23, 2009 (gmt 0)

10+ Year Member



Well shoot. I was hoping there was a way to do with without any fancy extra work. I simply wrote a PHP script to make the listing for me and make links out of said file list, so I'm golden.

Thanks for all o' ya'lls help,

-Sootah

maximillianos

12:04 pm on Apr 23, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Such a browser feature would be a security issue... ;-)

phranque

8:22 am on Apr 24, 2009 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



what you should do is create a simple script to list the contents of a directory, name it Sootahs-directory-lister.php or something more obscure and put it in your test directory. (which should be password protected, right?)
then request http://example.com/test-directory/Sootahs-directory-lister.php in your browser.

I cannot always remember the filename of what I'm looking for without having to FTP in to find out

... i mean something less obscure

Sootah

11:16 am on Apr 25, 2009 (gmt 0)

10+ Year Member



what you should do is create a simple script to list the contents of a directory

Which is exactly what I said I did in my previous post just above yours.. :)

 

Featured Threads

Hot Threads This Week

Hot Threads This Month