You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wiki-changes@httpd.apache.org by Apache Wiki <wi...@apache.org> on 2008/12/31 04:29:52 UTC

[Httpd Wiki] Update of "RewriteFlags/R" by RichBowen

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Httpd Wiki" for change notification.

The following page has been changed by RichBowen:
http://wiki.apache.org/httpd/RewriteFlags/R

New page:
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"] ''