How to secure your htaccess file?

For security reasons, the [.htaccess] file contents should not be visible to the public. To secure it, add the following lines to the [.htaccess] file:

# Prevent Apache from serving .ht* files:
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
</FilesMatch>

  • 138 Users Found This Useful
Was this answer helpful?

Related Articles

How to enable Server Side Includes (SSI) using htaccess?

If you are using Server Side Includes SSI in your HTML files, and they are not working, you most...

Error uploading large files (memory, HTTP or timeout error)

Change the following values in the [.htaccesss] file to upload large files:...

How to change PHP configuration (memory, upload limit, and others) using the .htaccess file?

  PHP configuration (directives) like PHP memory limit, maximum upload size, post max size, and...