0

I am making a website, and I want the users to be able to access a file folder. I have a link to a folder. When I do this locally, all works fine. But when I upload it to my site, I get:

Forbidden

You don't have permission to access /MyFileSystem/ on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

There are nothing but text files (.cs) and subfolders in the main folder.

How can I grant permissions to the world to view that folder system?

I am looking for it to be along the lines of this:

enter image description here

3
  • You likely do not have an index.html file and directory browsing is not enabled. It is not necessarily a permissions thing. Directory browsing is where the browser lists the contents of a directory instead of an HTML page. Is this what you want?
    – closetnoc
    Nov 27, 2014 at 3:25
  • @closetnoc I think so? I want it to be a page where you can open folders and open files. If you open the folder, the file system becomes a list of subfolders and files. If you open a file, the page just becomes the text file. I posted above what I am looking for.
    – Evorlor
    Nov 27, 2014 at 3:27
  • Let me know how this works for you. I am here everyday if you need me!
    – closetnoc
    Nov 27, 2014 at 3:44

1 Answer 1

1

Okay. This is a fairly easy one.

Here is a link to some documentation you want to become familiar with. It is a bit difficult to understand at fist, but I promise you this stuff is really easy once you start to get into it. Keep reading the documentation and do a few searches around the net for examples and you will soon get it.

http://httpd.apache.org/docs/current/howto/htaccess.html

In this case, you want to create an .htaccess file in the directory where you want your listing. Then put the following into the file:

Options +Indexes

Save the file. That is it. See? Easy! Just make sure you are not putting in dangerous files that are executable. For that, come back and we will have to explore more on how to make it secure for that. But that does not sound like what you are doing anyway.

Somewhere in the documentation are some instructions on customizing the look of the directory that is created if that is what you want to do. I generally leave it as is.

2
  • Works like a charm, and so easy! Thanks!! I wish I could upvote this multiple times. Good reference as well.
    – Evorlor
    Nov 27, 2014 at 3:44
  • Anytime! I do this for fun.
    – closetnoc
    Nov 27, 2014 at 3:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.