PDA

View Full Version : see folder content



tanel96
March 20th, 2007, 05:19 AM
I'm sure this topic has already been discussed several times, but unfortunaltely i couldn't find what i was looking for by using the search.

I have an account on MediaTemple... but the server does not display the list of files in my subfolders, it says that "You don't have permission to access /foldername/ on this server"

Is there a way to add a .htaccess file to let the server know that it is okey to display the folder content ?

I'm sure that i could do this via Media Temple control panel as well, but havent quite mastered it yet :)

foodpk
March 20th, 2007, 07:34 AM
If you have the permission to set per-directory directives with .htaccess (that is to say, if AllowOverride is active for your directory), make a file called .htaccess and in put the following:

<Directory /path/to/directory>
Options +Indexes
</Directory>

/path/to/directory is, well, the path to your directory, relative to the root of the server.

tanel96
March 20th, 2007, 10:01 AM
after adding the .htaccess file i get a 500 "Internal Server Error" message...

so i probably have to do it through mediatemple control panel

foodpk
March 20th, 2007, 11:10 AM
I'm sorry, I mistakenly provided you with the wrong information. Try removing the 'tags' from the .htaccess
So your .htaccess in that folder should contain


Options +Indexes
I tried it on my server and got the 500 but then I removed the <Directory /path> and </Directory> and it worked like a charm.
You should use <Directory /path> when you're giving per directory directives in your httpd.conf file, so the file knows which directory to take into account.