Name
RewriteCond
Synopsis
RewriteCond TestString
CondPattern
Server config, virtual host, directory
One or more
RewriteCond
directives can precede a
RewriteRule directive to define conditions under
which it is to be applied. CondPattern is
a regular expression matched against the value retrieved for
TestString, which contains server
variables of the form
%{
NAME_OF_VARIABLE
},
where NAME_OF_VARIABLE can be one of the
following list:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
|
|
|
These variables all correspond to the similarly named HTTP MIME
headers, C variables of the Apache server, or the current time. If
the regular expression does not match, the
RewriteRule following it does not apply.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access