Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Server: Apache 2.2.17

I have the next .htaccess file:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule !^includes/ - [S=1]
RewriteRule ^includes/[^/]+\.php$ - [F,L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

As you can see, I'm forbidding users to access all php files that are inside the "includes" directory. Besides php files, I also have another directory and an image inside "includes", but I don't have an index file. So why forbidding all php files this way denies access to the directory listing?

PHP files are forbidden, and I can access the image and get inside the other directory inside "includes". But the listing of files in the "includes" directory is denied. Why?

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.