Apache Directives Reference

Key Apache httpd directives filterable by context and module.

Searchable Apache HTTP Server directive reference with valid context, AllowOverride class, syntax, status flag and providing module — covering RewriteRule, Require, Header, ProxyPass and more.

What does the Override column mean?

It names the AllowOverride class (FileInfo, AuthConfig, Options, Indexes, Limit, All) that must be enabled for a directory before the directive may appear in a .htaccess file. If the class is off, the directive is ignored or causes a 500 error.

Look up Apache httpd directives without the manual

Apache HTTP Server is configured by directives, and each one has rules about where it may appear and whether a .htaccess file can use it. This reference lets you search directives by name, module or description and filter by status, showing the valid context, the AllowOverride class, the syntax and the providing module. It runs entirely in your browser.

How it works

Each entry lists the directive, its module (e.g. mod_rewrite), the status flag, the syntax, the contexts it is valid in, and the AllowOverride class that lets it appear in .htaccess. Apache processes directives from the main config down through <VirtualHost>, <Directory> and .htaccess files. A directive only works inside .htaccess if its override class is enabled for that directory. A typical rewrite to force HTTPS looks like:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Validate changes with apachectl configtest and apply them with apachectl graceful.

Tips and examples

  • To allow .htaccess overrides for a directory, set AllowOverride FileInfo (for rewrites/headers) or AllowOverride All in the matching <Directory> block; the default None ignores .htaccess entirely.
  • Restrict access with Require ip 192.168.1.0/24 or open it with Require all granted — these are the 2.4 replacements for Allow/Deny.
  • Use Header always set Strict-Transport-Security "max-age=31536000" to send HSTS even on error responses.
  • ProxyPass "/api" "http://127.0.0.1:3000/" turns Apache into a reverse proxy when mod_proxy and mod_proxy_http are loaded.