The R flag forces a redirection. If you make the substitution a fully-qualified URL, this will force an external redirection. Additionally, you can specify a redirection status code, in the range 300-400. The default is a 302 (MOVED TEMPORARILY) status code.

  • Examples:*

The following example is a trifle silly, as it can be better (more efficiently) accomplished with a simple Redirect, but perhaps it will convey the idea. This example will redirect any request to your site to that same URL request on the other site. That is to say, the URL _ will be redirected to _ And this will all be done with a status code of 303 (SEE OTHER).

RewriteEngine On
RewriteRule (.*)$1 [R=303]

Also valid is the verbose syntax 'redirect' instead of R.

RewriteRule (.*)$1 [redirect=303]

_ Back to RewriteFlags_

  • No labels