Updated: 28 September 2026 · Applies to: Apache 2.4 (.htaccess)

Your .htaccess file contains your site's rewrite and security rules, so it should never be downloadable. Apache blocks files starting with .ht by default on our servers; you can add the rule yourself as extra protection.

Add to .htaccess

<Files ~ "^\.ht">
    Require all denied
</Files>

Test it by opening https://yourdomain.com/.htaccess: you should get a "403 Forbidden" error.

Note: The older Order allow,deny / Deny from all syntax is from Apache 2.2. It still works through a compatibility module, but use Require on Apache 2.4.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Managed dedicated servers

our engineers look after the server for you, from $135 a month.

Was this answer helpful?

Still stuck? Open a ticket