RewriteCondition [ condition pattern]
Default
None
Context
server config, <Global>, <VirtualHost>, <Anonymous>, <Directory>
Module
mod_rewrite
Compatibility
1.2.6rc1 and later
The RewriteCondition directive defines a rule condition. Precede a RewriteRule directive with one or more RewriteCondition directives. The following rewriting rule is only used if its pattern matches the current state of the FTP command and if these additional conditions apply too.
Condition is a string which can contain the following expanded constructs in addition to plain text:
RewriteRule backreferences
These are backreferences of the form:
$N
(0 <= N <= 9) which provide access to the grouped parts (parentheses!) of the pattern from the corresponding RewriteRule directive (the one following the current bunch of RewriteCondition directives). Note that $0 will refer back to the entire original string being matched.
RewriteCondition backreferences
These are backreferences of the form:
%N
(0 <= N <= 9) which provide access to the grouped parts (parentheses!) of the pattern from the previous RewriteCondition attached to this RewriteRule.
RewriteMap expansions:
These are expansions of the form:
${map-name:lookup-key|default-value}
See the documentation for RewriteMap for more details.
Variable substitutions:
These are substitutions of the form:
%a client IP address
%c name of Class for current session
%f filename
%F transfer path, as seen by the client (only useful for upload/download commands)
%g primary group of authenticated user
%G supplemental groups of authenticated user
%h client DNS name
%m FTP command
%p port of server handling the session
%u name of authenticated user
%U name of user sent by client via USER
%v ServerName of server handling the session
Pattern is the condition pattern, i.e., a regular expression which is applied to the current instance of the condition, i.e., condition is evaluated and then matched against pattern. You can prefix the pattern string with a '!' character (exclamation mark) to specify a non-matching pattern.