From: Rich Bowen Date: Thu, 5 Nov 2009 00:12:41 +0000 (+0000) Subject: Relocates another recipe, and updates it. X-Git-Tag: 2.3.3~43 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f73825dd444119f4b2543d2e16d64ad9811ebd70;p=apache Relocates another recipe, and updates it. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@832923 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/rewrite/remapping.html.en b/docs/manual/rewrite/remapping.html.en index 70a74aad54..598c4583c6 100644 --- a/docs/manual/rewrite/remapping.html.en +++ b/docs/manual/rewrite/remapping.html.en @@ -36,6 +36,7 @@ configuration.
top
+
+

Resource Moved to Another Server

+ + + +
+
Description:
+ +
+

If a resource has moved to another server, you may wish to have + URLs continue to work for a time on the old server while people + update their bookmarks.

+
+ +
Solution:
+ +
+

You can use mod_rewrite to redirect these URLs + to the new server, but you might also consider using the Redirect + or RedirectMatch directive.

+ +

With mod_rewrite

+RewriteEngine on
+RewriteRule   ^/docs/(.+)  http://new.example.com/docs/$1  [R,L]
+
+ +

With RedirectMatch

+RedirectMatch ^/docs/(.*) http://new.example.com/docs/$1
+
+ +

With Redirect

+Redirect /docs/ http://new.example.com/docs/
+
+
+
+
top

From Static to Dynamic

@@ -178,11 +216,14 @@ RewriteRule ^foo\.html$ foo.cgi [H=
@@ -196,6 +237,7 @@ RewriteRule ^(.*).html$ $1.php directives are evaluated. This allows us to test for the existence of the the original (document.html) and target (document.php) files using the same base filename.

+

This ruleset is designed to use in a per-directory context (In a <Directory> block or in a .htaccess file), so that the -f checks are looking at the correct directory path. diff --git a/docs/manual/rewrite/remapping.xml b/docs/manual/rewrite/remapping.xml index 8850219280..b71cad1949 100644 --- a/docs/manual/rewrite/remapping.xml +++ b/docs/manual/rewrite/remapping.xml @@ -118,6 +118,45 @@ RewriteRule ^/foo\.html$ bar.html [ +

+ + Resource Moved to Another Server + +
+
Description:
+ +
+

If a resource has moved to another server, you may wish to have + URLs continue to work for a time on the old server while people + update their bookmarks.

+
+ +
Solution:
+ +
+

You can use mod_rewrite to redirect these URLs + to the new server, but you might also consider using the Redirect + or RedirectMatch directive.

+ +With mod_rewrite
+RewriteEngine on
+RewriteRule   ^/docs/(.+)  http://new.example.com/docs/$1  [R,L]
+
+ +With RedirectMatch
+RedirectMatch ^/docs/(.*) http://new.example.com/docs/$1
+
+ +With Redirect
+Redirect /docs/ http://new.example.com/docs/
+
+
+
+ +
+ + +
From Static to Dynamic @@ -177,11 +216,14 @@ RewriteRule ^foo\.html$ foo.cgi [H= @@ -195,6 +237,7 @@ RewriteRule ^(.*).html$ $1.php directives are evaluated. This allows us to test for the existence of the the original (document.html) and target (document.php) files using the same base filename.

+

This ruleset is designed to use in a per-directory context (In a <Directory> block or in a .htaccess file), so that the -f checks are looking at the correct directory path. diff --git a/docs/manual/rewrite/rewrite_guide.html.en b/docs/manual/rewrite/rewrite_guide.html.en index bafa180a02..010c78e26d 100644 --- a/docs/manual/rewrite/rewrite_guide.html.en +++ b/docs/manual/rewrite/rewrite_guide.html.en @@ -44,7 +44,6 @@

top
-

Move Homedirs to Different Webserver

- - - -
-
Description:
- -
-

Many webmasters have asked for a solution to the - following situation: They wanted to redirect just all - homedirs on a webserver to another webserver. They usually - need such things when establishing a newer webserver which - will replace the old one over time.

-
- -
Solution:
- -
-

The solution is trivial with mod_rewrite. - On the old webserver we just redirect all - /~user/anypath URLs to - http://newserver/~user/anypath.

- -
-RewriteEngine on
-RewriteRule   ^/~(.+)  http://newserver/~$1  [R,L]
-
-
-
- -
top
-

Set Environment Variables According To URL Parts

diff --git a/docs/manual/rewrite/rewrite_guide.xml b/docs/manual/rewrite/rewrite_guide.xml index b3b2166b4b..106ca72c32 100644 --- a/docs/manual/rewrite/rewrite_guide.xml +++ b/docs/manual/rewrite/rewrite_guide.xml @@ -191,38 +191,6 @@ RewriteRule ^(.+[^/])$ $1/ [R]
-
- - Move Homedirs to Different Webserver - -
-
Description:
- -
-

Many webmasters have asked for a solution to the - following situation: They wanted to redirect just all - homedirs on a webserver to another webserver. They usually - need such things when establishing a newer webserver which - will replace the old one over time.

-
- -
Solution:
- -
-

The solution is trivial with mod_rewrite. - On the old webserver we just redirect all - /~user/anypath URLs to - http://newserver/~user/anypath.

- -
-RewriteEngine on
-RewriteRule   ^/~(.+)  http://newserver/~$1  [R,L]
-
-
-
- -
-
Set Environment Variables According To URL Parts