From 13cec8a9d09a90e66c139b414d86f8bc955c516b Mon Sep 17 00:00:00 2001 From: Rich Bowen Date: Sat, 21 Nov 2009 00:27:17 +0000 Subject: [PATCH] Starts on the vhosts document. Need to eliminate duplication with the main /docs/vhosts/mass.html doc. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@882806 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/rewrite/remapping.html.en | 73 --------------------------- docs/manual/rewrite/remapping.xml | 73 --------------------------- docs/manual/rewrite/vhosts.html.en | 57 ++++++++++++++++++++- docs/manual/rewrite/vhosts.xml | 56 ++++++++++++++++++++ 4 files changed, 112 insertions(+), 147 deletions(-) diff --git a/docs/manual/rewrite/remapping.html.en b/docs/manual/rewrite/remapping.html.en index 87e6a20c20..2d712c32f3 100644 --- a/docs/manual/rewrite/remapping.html.en +++ b/docs/manual/rewrite/remapping.html.en @@ -44,10 +44,8 @@ configuration.
  • Redirecting to Geographically Distributed Servers
  • Browser Dependent Content
  • Canonical URLs
  • -
  • Virtual Hosts Per User
  • Moved DocumentRoot
  • Fallback Resource
  • -
  • Mass Virtual Hosting
  • See also

    top
    @@ -487,61 +485,6 @@ RewriteRule ^/(puppies|canines)/(.*) /dogs/$2 [R] -
    top
    -
    -

    Virtual Hosts Per User

    - - - -
    -
    Description:
    - -
    -

    We want to automatically create a virtual host for every user who - has an account on our web server system, without having to create - new VirtualHost sections.

    - -

    In this recipe, we assume that we'll be using the hostname - www.username.example.com for each - user, and serve their content out of - /home/username/www.

    -
    - -
    Solution:
    - -
    - -
    -RewriteEngine on
    -RewriteCond   %{HTTP_HOST}        ^www\.([^.]+)\.example\.com$
    -RewriteRule   ^(.*) /home/%1/www$1
    -
    - -
    Discussion
    -
    - -
    You will need to take care of the DNS - resolution - Apache does - not handle name resolution. You'll need either to create CNAME - records for each hostname, or a DNS wildcard record. Creating DNS - records is beyond the scope of this document.
    - -

    Parentheses used in a RewriteCond are captured into the -backreferences %1, %2, etc, while parentheses -used in RewriteRule are -captured into the backreferences $1, $2, -etc.

    - -

    -As with many techniques discussed in this document, mod_rewrite really -isn't the best way to accomplish this task. You should, instead, -consider using mod_vhost_alias instead, as it will much -more gracefully handle anything beyond serving static files, such as any -dynamic content, and Alias resolution. -

    -
    -
    -
    top

    Moved DocumentRoot

    @@ -638,22 +581,6 @@ file, as well as in a <Directory> block.

    -
    top
    -
    -

    Mass Virtual Hosting

    - - - -
    -
    Description:
    - -
    -

    Mass virtual hosting is one of the more common uses of - mod_rewrite. However, it is seldom the best way to handle mass - virtual hosting. This topic is discussed at great length in the virtual host documentation.

    -
    -
    -

    Available Languages:  en 

    diff --git a/docs/manual/rewrite/remapping.xml b/docs/manual/rewrite/remapping.xml index c91ca97f1c..5a596cff15 100644 --- a/docs/manual/rewrite/remapping.xml +++ b/docs/manual/rewrite/remapping.xml @@ -489,62 +489,6 @@ RewriteRule ^/(puppies|canines)/(.*) /dogs/$2 [R] -
    - - Virtual Hosts Per User - -
    -
    Description:
    - -
    -

    We want to automatically create a virtual host for every user who - has an account on our web server system, without having to create - new VirtualHost sections.

    - -

    In this recipe, we assume that we'll be using the hostname - www.username.example.com for each - user, and serve their content out of - /home/username/www.

    -
    - -
    Solution:
    - -
    - -
    -RewriteEngine on
    -RewriteCond   %{HTTP_HOST}        ^www\.([^.]+)\.example\.com$
    -RewriteRule   ^(.*) /home/%1/www$1
    -
    - -
    Discussion
    -
    - - You will need to take care of the DNS - resolution - Apache does - not handle name resolution. You'll need either to create CNAME - records for each hostname, or a DNS wildcard record. Creating DNS - records is beyond the scope of this document. - -

    Parentheses used in a RewriteCond are captured into the -backreferences %1, %2, etc, while parentheses -used in RewriteRule are -captured into the backreferences $1, $2, -etc.

    - -

    -As with many techniques discussed in this document, mod_rewrite really -isn't the best way to accomplish this task. You should, instead, -consider using mod_vhost_alias instead, as it will much -more gracefully handle anything beyond serving static files, such as any -dynamic content, and Alias resolution. -

    -
    -
    - -
    -
    Moved <code>DocumentRoot</code> @@ -649,21 +593,4 @@ file, as well as in a <Directory> block.

    -
    - - Mass Virtual Hosting - -
    -
    Description:
    - -
    -

    Mass virtual hosting is one of the more common uses of - mod_rewrite. However, it is seldom the best way to handle mass - virtual hosting. This topic is discussed at great length in the virtual host documentation.

    -
    -
    - -
    - diff --git a/docs/manual/rewrite/vhosts.html.en b/docs/manual/rewrite/vhosts.html.en index 98e664574a..5a2ee588a8 100644 --- a/docs/manual/rewrite/vhosts.html.en +++ b/docs/manual/rewrite/vhosts.html.en @@ -33,7 +33,62 @@ mod_rewrite.

    See also

    - +
    top
    +
    +

    Virtual Hosts Per User

    + + + +
    +
    Description:
    + +
    +

    We want to automatically create a virtual host for every user who + has an account on our web server system, without having to create + new VirtualHost sections.

    + +

    In this recipe, we assume that we'll be using the hostname + www.username.example.com for each + user, and serve their content out of + /home/username/www.

    +
    + +
    Solution:
    + +
    + +
    +RewriteEngine on
    +RewriteCond   %{HTTP_HOST}        ^www\.([^.]+)\.example\.com$
    +RewriteRule   ^(.*) /home/%1/www$1
    +
    + +
    Discussion
    +
    + +
    You will need to take care of the DNS + resolution - Apache does + not handle name resolution. You'll need either to create CNAME + records for each hostname, or a DNS wildcard record. Creating DNS + records is beyond the scope of this document.
    + +

    Parentheses used in a RewriteCond are captured into the +backreferences %1, %2, etc, while parentheses +used in RewriteRule are +captured into the backreferences $1, $2, +etc.

    + +

    +As with many techniques discussed in this document, mod_rewrite really +isn't the best way to accomplish this task. You should, instead, +consider using mod_vhost_alias instead, as it will much +more gracefully handle anything beyond serving static files, such as any +dynamic content, and Alias resolution. +

    +
    +
    + +

    Available Languages:  en