saved by17 people, first byMarco on 2006-04-25, last byWill Bolton on 2008-07-03
RewriteCond test_string cond_pattern.
You can include backreferences and server variable names (%{VARNAME})
in the substitution. Backreferences to this RewriteRule should be written as
$N, whereas backreferences to the previous RewriteCond should be written
as %N.
A special substitution is -. This substitution tells Apache to not
perform any substitution. I personally find that this is useful when using the
F or G flags (see below), but there are other uses as well.
This is the only part of the RewriteRule which isn’t mandatory. Any flags which you
use should be surrounded in square brackets, and comma separated. The flags which
I find to be most useful are:
F -
Forbidden. The user will receive a 403 error.
L -
Last Rule. No more rules will be proccessed if this one was successful.
R[=code] -
Redirect. The user’s web browser will be visibly redirected to the substituted
URL. If you use this flag, you must prefix the substitution with
http://www.somesite.com/, thus making it into a true URL. If no
code is given, then a HTTP reponse of 302 (temporarily moved) is sent.