Differences between revisions 1 and 2
Revision 1 as of 2008-12-31 03:29:50
Size: 980
Editor: RichBowen
Comment:
Revision 2 as of 2009-09-20 22:13:30
Size: 980
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 18: Line 18:
'' Back to ["RewriteFlags"] '' '' Back to [[RewriteFlags]] ''

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 http://your.host.com/something/here will be redirected to http://other.example.net/something/here. And this will all be done with a status code of 303 (SEE OTHER).

RewriteEngine On
RewriteRule (.*) http://other.example.com$1 [R=303]

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

RewriteRule (.*) http://other.example.com$1 [redirect=303]

Back to RewriteFlags

RewriteFlags/R (last edited 2009-09-20 22:13:30 by localhost)