You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@apache.org on 2009/11/27 19:27:27 UTC
svn commit: r884943 - in /httpd/httpd/trunk/docs/manual/vhosts: mass.html.en
mass.xml mass.xml.ko mass.xml.tr
Author: rbowen
Date: Fri Nov 27 18:27:26 2009
New Revision: 884943
URL: http://svn.apache.org/viewvc?rev=884943&view=rev
Log:
Replaces the two-step process with a single rule using the RewriteCond
backreference. This technique is far simpler, and far easier to explain
to beginners than the unnecessarily complicated technique used.
Modified:
httpd/httpd/trunk/docs/manual/vhosts/mass.html.en
httpd/httpd/trunk/docs/manual/vhosts/mass.xml
httpd/httpd/trunk/docs/manual/vhosts/mass.xml.ko
httpd/httpd/trunk/docs/manual/vhosts/mass.xml.tr
Modified: httpd/httpd/trunk/docs/manual/vhosts/mass.html.en
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/vhosts/mass.html.en?rev=884943&r1=884942&r2=884943&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/vhosts/mass.html.en (original)
+++ httpd/httpd/trunk/docs/manual/vhosts/mass.html.en Fri Nov 27 18:27:26 2009
@@ -356,8 +356,10 @@
<h2><a name="homepages.rewrite" id="homepages.rewrite">A
Homepages System Using <code>mod_rewrite</code></a></h2>
- <p>This does the same thing as <a href="#homepages">the second
- example</a>.</p>
+ <p>This is similar to <a href="#homepages">the one above</a>,
+ but also verifies that the hostname falls into a specific subset of
+ hostnames - in this case, that it looks like
+ <code>www.<strong>SITE</strong>.example.com</code>.</p>
<div class="example"><p><code>
RewriteEngine on<br />
@@ -367,15 +369,11 @@
# allow CGIs to work<br />
RewriteCond %{REQUEST_URI} !^/cgi-bin/<br />
<br />
-# check the hostname is right so that the RewriteRule works<br />
-RewriteCond ${lowercase:%{SERVER_NAME}} ^www\.[a-z-]+\.isp\.com$<br />
+# Capture the site name in the backreference variable %1<br />
+RewriteCond ${lowercase:%{SERVER_NAME}} ^www\.([a-z-]+)\.example\.com$<br />
<br />
-# concatenate the virtual host name onto the start of the URI<br />
-# the [C] means do the next rewrite on the result of this one<br />
-RewriteRule ^(.+) ${lowercase:%{SERVER_NAME}}$1 [C]<br />
-<br />
-# now create the real file name<br />
-RewriteRule ^www\.([a-z-]+)\.isp\.com/(.*) /home/$1/$2<br />
+# Map the request to the site's document directory<br />
+RewriteRule ^(.*) /home/%1/$1<br />
<br />
# define the global CGI directory<br />
ScriptAlias /cgi-bin/ /www/std-cgi/
Modified: httpd/httpd/trunk/docs/manual/vhosts/mass.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/vhosts/mass.xml?rev=884943&r1=884942&r2=884943&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/vhosts/mass.xml (original)
+++ httpd/httpd/trunk/docs/manual/vhosts/mass.xml Fri Nov 27 18:27:26 2009
@@ -349,8 +349,10 @@
<section id="homepages.rewrite"><title>A
Homepages System Using <code>mod_rewrite</code></title>
- <p>This does the same thing as <a href="#homepages">the second
- example</a>.</p>
+ <p>This is similar to <a href="#homepages">the one above</a>,
+ but also verifies that the hostname falls into a specific subset of
+ hostnames - in this case, that it looks like
+ <code>www.<strong>SITE</strong>.example.com</code>.</p>
<example>
RewriteEngine on<br />
@@ -360,15 +362,11 @@
# allow CGIs to work<br />
RewriteCond %{REQUEST_URI} !^/cgi-bin/<br />
<br />
-# check the hostname is right so that the RewriteRule works<br />
-RewriteCond ${lowercase:%{SERVER_NAME}} ^www\.[a-z-]+\.isp\.com$<br />
+# Capture the site name in the backreference variable %1<br />
+RewriteCond ${lowercase:%{SERVER_NAME}} ^www\.([a-z-]+)\.example\.com$<br />
<br />
-# concatenate the virtual host name onto the start of the URI<br />
-# the [C] means do the next rewrite on the result of this one<br />
-RewriteRule ^(.+) ${lowercase:%{SERVER_NAME}}$1 [C]<br />
-<br />
-# now create the real file name<br />
-RewriteRule ^www\.([a-z-]+)\.isp\.com/(.*) /home/$1/$2<br />
+# Map the request to the site's document directory<br />
+RewriteRule ^(.*) /home/%1/$1<br />
<br />
# define the global CGI directory<br />
ScriptAlias /cgi-bin/ /www/std-cgi/
Modified: httpd/httpd/trunk/docs/manual/vhosts/mass.xml.ko
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/vhosts/mass.xml.ko?rev=884943&r1=884942&r2=884943&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/vhosts/mass.xml.ko [euc-kr] (original)
+++ httpd/httpd/trunk/docs/manual/vhosts/mass.xml.ko [euc-kr] Fri Nov 27 18:27:26 2009
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='EUC-KR' ?>
<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
<?xml-stylesheet type="text/xsl" href="../style/manual.ko.xsl"?>
-<!-- English Revision: 151408:884925 (outdated) -->
+<!-- English Revision: 151408:884934 (outdated) -->
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
Modified: httpd/httpd/trunk/docs/manual/vhosts/mass.xml.tr
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/vhosts/mass.xml.tr?rev=884943&r1=884942&r2=884943&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/vhosts/mass.xml.tr [utf-8] (original)
+++ httpd/httpd/trunk/docs/manual/vhosts/mass.xml.tr [utf-8] Fri Nov 27 18:27:26 2009
@@ -1,7 +1,7 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
<?xml-stylesheet type="text/xsl" href="../style/manual.tr.xsl"?>
-<!-- English Revision: 659902:884925 (outdated) -->
+<!-- English Revision: 659902:884934 (outdated) -->
<!-- =====================================================
Translated by: Nilgün Belma Bugüner <nilgun belgeler.org>
Reviewed by: Orhan Berent <berent belgeler.org>