search

Home  >  Q&A  >  body text

apache - How to set rules in .htaccess to prevent downloading of .htaccess files

I often receive alerts to download .htaccess which is quite annoying. I want to prohibit access to it, but I added rules in .httaccessRewriteRule /.(svn|git|htaccess) - [F,L] Invalid, it can block svn, git, but cannot block .htaccess access, and if the .htaccess accesses the subdirectory (the file does not exist), it can successfully block access.

Does anyone know how to set rules in the .htaccess file to prevent access to the .htaccess file? If I don’t want to set or try it elsewhere, just ask if it can be done in the .htaccess file.

滿天的星座滿天的星座2753 days ago810

reply all(1)I'll reply

  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-16 17:00:27

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

    reply
    0
  • Cancelreply