homepage Welcome to WebmasterWorld Guest from 54.204.94.228
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / WebmasterWorld / Webmaster General
Forum Library, Charter, Moderators: phranque

Webmaster General Forum

    
Can you force a directory listing in a websites folder?
Instead of pulling up the index.* page?
Sootah




msg:3895950
 8:13 am on Apr 20, 2009 (gmt 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

 

bill




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

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

janharders




msg:3895958
 8:34 am on Apr 20, 2009 (gmt 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.

kaled




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

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

No.

phranque




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

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

Sootah




msg:3898438
 9:09 am on Apr 23, 2009 (gmt 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

maximillianos




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

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

phranque




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

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




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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / Webmaster General
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved