Welcome to WebmasterWorld Guest from 54.147.237.64

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?

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

Junior Member

10+ Year Member

joined:July 11, 2005
posts: 112
votes: 0


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

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

Administrator from JP 

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

joined:Oct 12, 2000
posts:14962
votes: 125


On most of my servers the setting for directory listing is in the control panel that the hosting company provides.
8:34 am on Apr 20, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:May 31, 2008
posts:661
votes: 0


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.

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

Senior Member

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

joined:Mar 2, 2003
posts:3710
votes: 0


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

No.

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

Administrator

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

joined:Aug 10, 2004
posts:10752
votes: 45


you can't do it in the browser - it is entirely a server configuration issue.
9:09 am on Apr 23, 2009 (gmt 0)

Junior Member

10+ Year Member

joined:July 11, 2005
posts:112
votes: 0


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

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Dec 20, 2004
posts:2377
votes: 0


Such a browser feature would be a security issue... ;-)
8:22 am on Apr 24, 2009 (gmt 0)

Administrator

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

joined:Aug 10, 2004
posts:10752
votes: 45


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
11:16 am on Apr 25, 2009 (gmt 0)

Junior Member

10+ Year Member

joined:July 11, 2005
posts:112
votes: 0


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.. :)

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members