Mobile app version of vmapp.org
Login or Join
Goswami781

: Deny access to directory content on shared hosting service My Website is hosted on a shared Apache server. How can I deny access to directory content pages so if someone goes to the address

@Goswami781

Posted in: #Apache #SharedHosting

My Website is hosted on a shared Apache server. How can I deny access to directory content pages so if someone goes to the address mywebsite.com/directory they don't see the following:

Index of /directory

Parent Directory


mycontent/
moreofmycontent/

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Goswami781

1 Comments

Sorted by latest first Latest Oldest Best

 

@Jessie594

There are two common ways to prevent directory listing under Apache:


Create or edit the file called .htaccess in your web server's root directory and add the line:

Options -Indexes
Put blank index.html files in each subdirectory.


The first option is probably the best, unless you're distributing open source projects (like WordPress), when it's a good idea to use the blank index.html method to make sure subdirectories won't be listed by default for other people who download your project as well.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme