This is the htaccess file:
ErrorDocument 400 /index.php
ErrorDocument 401 /index.php
ErrorDocument 403 /index.php
ErrorDocument 404 /index.php
ErrorDocument 405 /index.php
<Files configure.php>
order allow,deny
deny from all
</Files>
the file configure.php is in some folder lets say /config/configure.php and now the problem is that I can download it ! by just making a link to it. And it is because of this line ErrorDocument 404 /index.php, when I delete this line I get a 404 error and cannot download the configure.php file. But why is it like so that this line (that I want to have) makes it possible to download the configure.php file ?
You need to place the .htaccess
file (not htaccess
without the leading dot) into the folder where configure.php
resides in (at least) to make the <Files configure.php>
-directiveDocs work. See as well Filesystem, Webspace, and Boolean ExpressionsDocs.
Related: Requests to .htaccess should return 404 instead of 403