Posted: . At: 12:17 PM. This was 8 years ago. Post ID: 9260
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.


How to block access to the .htaccess file on an Apache web server.


Blocking access to the .htaccess file on your Apache web server blocks access to the file by curious web users that want to see what directives are in it. The code below added to the .htaccess file will forbid all access to the .htaccess file by web users while still allowing it to function.

#Deny attempts to view the Htaccess file.
<Files .htaccess>
Order allow,deny
Deny from all
</Files>

Very important to add this code when setting up your web server.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.