From 03af895d972fce0a286e110c687a0e0e0c1d00a3 Mon Sep 17 00:00:00 2001 From: Rich Bowen Date: Tue, 17 Nov 2009 01:56:34 +0000 Subject: [PATCH] Moving yet another recipe. Almost done with this exercise. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@881091 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/rewrite/remapping.html.en | 48 ++++++++++++++++++++++ docs/manual/rewrite/remapping.xml | 44 ++++++++++++++++++++ docs/manual/rewrite/rewrite_guide.html.en | 49 +---------------------- docs/manual/rewrite/rewrite_guide.xml | 48 ---------------------- 4 files changed, 93 insertions(+), 96 deletions(-) diff --git a/docs/manual/rewrite/remapping.html.en b/docs/manual/rewrite/remapping.html.en index a788f5e489..452c9ae8dc 100644 --- a/docs/manual/rewrite/remapping.html.en +++ b/docs/manual/rewrite/remapping.html.en @@ -45,6 +45,7 @@ configuration.
  • Browser Dependent Content
  • Canonical URLs
  • Virtual Hosts Per User
  • +
  • Moved DocumentRoot
  • See also

    top
    @@ -537,6 +538,53 @@ dynamic content, and Alias resolution. +
    top
    +
    +

    Moved DocumentRoot

    + + + +
    +
    Description:
    + +
    +

    Usually the DocumentRoot +of the webserver directly relates to the URL "/". +But often this data is not really of top-level priority. For example, +you may wish for visitors, on first entering a site, to go to a +particular subdirectory /about/. This may be accomplished +using the following ruleset:

    +
    + +
    Solution:
    + +
    +

    We redirect the URL / to + /about/: +

    + +
    +RewriteEngine on
    +RewriteRule   ^/$  /about/  [R]
    +
    + +

    Note that this can also be handled using the RedirectMatch directive:

    + +

    +RedirectMatch ^/$ http://example.com/about/ +

    + +

    Note also that the example rewrites only the root URL. That is, it +rewrites a request for http://example.com/, but not a +request for http://example.com/page.html. If you have in +fact changed your document root - that is, if all of +your content is in fact in that subdirectory, it is greatly preferable +to simply change your DocumentRoot +directive, or move all of the content up one directory, +rather than rewriting URLs.

    +
    +
    +

    Available Languages:  en 

    diff --git a/docs/manual/rewrite/remapping.xml b/docs/manual/rewrite/remapping.xml index fd1374eb32..a1e48e74cc 100644 --- a/docs/manual/rewrite/remapping.xml +++ b/docs/manual/rewrite/remapping.xml @@ -543,8 +543,52 @@ dynamic content, and Alias resolution. +
    + Moved <code>DocumentRoot</code> +
    +
    Description:
    + +
    +

    Usually the DocumentRoot +of the webserver directly relates to the URL "/". +But often this data is not really of top-level priority. For example, +you may wish for visitors, on first entering a site, to go to a +particular subdirectory /about/. This may be accomplished +using the following ruleset:

    +
    + +
    Solution:
    +
    +

    We redirect the URL / to + /about/: +

    + +
    +RewriteEngine on
    +RewriteRule   ^/$  /about/  [R]
    +
    + +

    Note that this can also be handled using the RedirectMatch directive:

    + + +RedirectMatch ^/$ http://example.com/about/ + + +

    Note also that the example rewrites only the root URL. That is, it +rewrites a request for http://example.com/, but not a +request for http://example.com/page.html. If you have in +fact changed your document root - that is, if all of +your content is in fact in that subdirectory, it is greatly preferable +to simply change your DocumentRoot +directive, or move all of the content up one directory, +rather than rewriting URLs.

    +
    +
    + +
    diff --git a/docs/manual/rewrite/rewrite_guide.html.en b/docs/manual/rewrite/rewrite_guide.html.en index 73095f0a42..353e2801b5 100644 --- a/docs/manual/rewrite/rewrite_guide.html.en +++ b/docs/manual/rewrite/rewrite_guide.html.en @@ -41,8 +41,7 @@ avoids many problems.
    -