Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Create a .htaccess file to limit directory browsing

Posted on 2013-11-12
1
222 Views
Last Modified: 2013-11-14
Hello

I need to limit directory browsing on some folders and need to create the .htaccess file to do it. I have been advised to use the line

Options -Indexes

What else do I need to add in the file. Is it just the one line?

I will also be using permissions on the htaccess file of 0444. We just need to limit directory browsing only. Some of the folders we are going to use it on contain images for the website. This was a recommendation as a result of a PCI scan. There was also the suggestion of using a blank index.html file set to 0444. Not sure which is the best option here.
0
Comment
Question by:gregnvt
1 Comment
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39643161
I would suggest you do both.  Here's the Apache page on Options: http://httpd.apache.org/docs/2.2/mod/core.html#options

Second thought.  Permissions have to be 0644 for the owner to write the files.  If they don't need to be changed, then they could be set to 0444.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Recently, I read that Microsoft has analysed statistics for their security intelligence report. It revealed: still, the clear majority of windows users do their daily work as administrator. An administrative account is a burden, security-wise. My ar…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question