mod-rewrite Getting started with mod-rewrite Using mod_rewrite from the dynamic configuration files


Example

Important: Using the dynamic configuration files (.htaccess) is a big performance hit. When you have access to the static configuration file (httpd.conf or something similar) you should use that instead.

In the static configuration file, allow dynamic configuration files to override "Fileinfo" using AllowOverride. This directive must be placed in directory context:

AllowOverride FileInfo

The filename used for dynamic configuration files is governed by the AccessFileName directive. By default, the dynamic configuration files are hidden files called .htaccess.

At the top of each dynamic configuration file containing mod_rewrite directives, add the following directive:

RewriteEngine on