|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
Auto Listing of Folders and Files on Server
I want to be able to create a automatic list of all the folders and files in a certain directory on an apache server. I know how to do this with ASP and IIS, but don't have the foggiest for apache.
In terms of configuring apache, I have enabled AddModule mod_autoindex.c and have <Directory data> Options +Indexes FollowSymLinks </Directory> Are there any further configurations that are required? Do I have to write an index.php to retrieve the folder and file info? If so, can anyone direct me to a source/tutorial. I'm totally new to php and didn't see any articles on this point on the site. Thanks a lot |
|
#2
|
|||
|
|||
|
Re: Auto Listing of Folders and Files on Server
Quote:
Try this My friend... let me know how it goes. <Directory /data/> Options +Indexes FollowSymLinks </Directory>
__________________
__________________________________________________ _ Wil Moore III, MCP | Integrations Specialist | Senior Consultant Are You Listed...? | DigitallySmooth Inc. |
|
#3
|
|||
|
|||
|
Hi Wil,
Right now it seems to be pulling up an index.html page, so maybe there is something else I have to disable? Should the listing automatically appear or do I have to write a script in php to get that info to appear? |
|
#4
|
|||
|
|||
|
Quote:
Well, the problem is that you have an index.html page which overrides the directory index. What you can do is add this to your <directory> directive: DirectoryIndex now it won't show index.html by default. |
|
#5
|
|||
|
|||
|
I tried that and it still seems to be looking for an index.html file. Very annoying. I have know idea what the prob is because from what I've read and from what you've told me this should work. I've searched the conf file and there isn't even a reference to the html file (having removed it from the <directory> line of code), so I can't figure out where the instructions are coming from to find that file! Ugh.
|
|
#6
|
|||
|
|||
|
I put this in an .htaccess file and it worked. I don't know how syntactically correct it is, but I don't see why it would not work.
PHP Code:
|
|
#7
|
|||
|
|||
|
thanks I will try that - before I was just modifying the conf file.
|
|
#8
|
|||
|
|||
|
Well, honestly it should be working from the conf file, but there may be something hindering you from getting it to work.
For now I'd like to see if you can get it working in .htaccess, then we can go forward from there. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Auto Listing of Folders and Files on Server |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|