0

If I call the .htaccess file in the browser e.g. https://www.mycompany.com/.htaccess, then it is getting downloaded. Is there a way to fix this?

I added this block to my .htaccess file, but it does not help:

<Files "\.htaccess">
    Order allow,deny
    Deny from all
</Files>

This is obviously a security hole.

  • Doesn't your htaccess file has 0644 permission ? – Shashank Kumrawat Oct 26 '18 at 8:09
  • @ShashankKumrawat, it has -rw-r--r-- (644) – Black Oct 26 '18 at 9:08
0

Please use this Code spinnet

<Files .htaccess>
    order allow,deny
    deny from all
</Files>

Do not use <Files "\.htaccess">

0

I solved it with this code:

<Files .htaccess>
    <IfVersion < 2.4>
        order allow,deny
        deny from all
    </IfVersion>
    <IfVersion >= 2.4>
        Require all denied
    </IfVersion>
</Files>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.