Prevent direct access to .htaccess file

.htaccess, apache, regex

Solution

You're blocking `.htaccess` but accessing `http://localhost/cms/htaccess`

Try accessing `http://localhost/cms/.htaccess`

If you want to block both try this `FilesMatch` directive with regex:

<FilesMatch "\.?htaccess$">
 order allow,deny
 deny from all
</FilesMatch>

Problem

i need to prevent access to `.htaccess` file. my file is: ``` # secure htaccess file <Files .htaccess> order allow,deny deny from all </Files> # disable directory browsing Options All -Indexes ``` when i check URL : `http://localhost/cms/htaccess` I see `.htaccess` file data How do i can `prevent/deny` access to `.htaccess` file?

Original source