SHARE
Facebook X Pinterest WhatsApp

Using .htaccess Files with Apache Page 4

Written By
thumbnail Ken Coar
Ken Coar
Jul 19, 2000
ServerWatch content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More



If your .htaccess file contains directives that aren’t
covered by the current set of override categories, they won’t
cause an error — the server will just ignore them. So your
file can contain directives in any — or all — of the categories,
and only those in the categories listed in the AllowOverride
list will be processed. All of the others will be checked for
syntax, but otherwise not interpreted.

Overrides: Limiting Which Directives Will
Be Processed

Apache directives fall into seven different categories, and all can
appear in the server-wide config files. Only five of the categories
can be used in .htaccess files, though, and in order for
Apache to accept a directive in a per-directory file,
the settings for the directory must permit the directive’s
category to be overridden.

The five categories of directives are:

AuthConfig
This category is intended to be used to control
directives that have to do with Web page security, such as
the AuthName, Satisfy, and Require
directives. This is the most common category to allow to be
overridden, as it allows users to protect their own documents.
FileInfo
Directives that control how files are processed are
Indexes
Directives that affect file listings should be in this
category. It includes IndexOptions,
AddDescription, and DirectoryIndex,
for example.
Limit
This category is similar to the AuthConfig one
in that the directives it covers are typically related to
security. However, they usually involve involuntary
controls, such as controlling access by IP address.
Directive in this category include Order,
Allow, and Deny.
Options
The Options category is intended for directives
that support miscellaneous options, such as
ContentDigest, XBitHack, and
Options itself.

A special directive, which is usable only in the server-wide
configuration files, dictates which categories may be overridden
in any particular directory tree.
The AllowOverride directive accepts two special
keywords in addition to the category names listed above:

All
This is a shorthand way of listing all of the
categories; the two statements below are equivalent:
    
    AllowOverride AuthConfig FileInfo Indexes Limits Options
    AllowOverride All
    
None
This keyword totally disables the processing of
.htaccess files for the specified directory and
its descendants (unless another AllowOverride
directive for a subdirectory is defined in the server config files).
‘Disabled’ means that Apache won’t even look for
.htaccess files, much less process them. This
can result in a performance savings, and is why the
default httpd.conf file includes such a
directive for the top-level system directory.
.htaccess processing is disabled for all
directories by default by that directive, and is only
selectively enabled for those trees where it makes
sense.
thumbnail Ken Coar

Ken Coar is a ServerWatch contributor.

Recommended for you...

What Is a Container? Understanding Containerization
What Is a Print Server? | How It Works and What It Does
Nisar Ahmad
Dec 8, 2023
6 Best Linux Virtualization Software for 2024
What Is a Network Policy Server (NPS)? | Essential Guide
ServerWatch Logo

ServerWatch is a top resource on servers. Explore the latest news, reviews and guides for server administrators now.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.