Click here to Skip to main content
15,889,211 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i am recieveing
C#
Directory access is forbidden.
error.
how can i remove this error ? i am getting this error on all my diretories whenever m making a sub directory.

What I have tried:

1.cleared cache
cleared trash from cpanel
Posted
Updated 25-Apr-16 22:53pm
Comments
Sergey Alexandrovich Kryukov 26-Apr-16 10:49am    
Why removing this legitimate error? Do you really need directory listing? Why? Maybe you simply need to add an index file. :-)
—SA

1 solution

To solve this you must define what should be displayed: A directory listing or a default page (usually an index page) when it is present.

See DirectoryListings - Httpd Wiki[^] for the required Apache configuration settings.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 26-Apr-16 10:48am    
It's unlikely that it was the inquirer's intent. Directory listings usually should be hidden. Maybe the problem is just the lack of index file...
—SA
Jochen Arndt 26-Apr-16 11:25am    
As often the intention of the questioner is not clear.
But I think my solution (the link) is solving the problem:

Allow directory listings if this is really wanted or provide a file with a name listed in the DirectoryIndex directive to avoid the error.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900