httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cove...@apache.org
Subject svn commit: r728400 - in /httpd/httpd/trunk/docs/manual/rewrite: rewrite_guide.html.en rewrite_guide.xml rewrite_guide_advanced.html.en rewrite_guide_advanced.xml
Date Sun, 21 Dec 2008 08:08:53 GMT
Author: covener
Date: Sun Dec 21 00:08:52 2008
New Revision: 728400

URL: http://svn.apache.org/viewvc?rev=728400&view=rev
Log:
Update examples to be more per-directory agnostic, identify examples that 
seem to be inherently per-directory oriented (REQUEST_URI vs REQUEST_FILENAME)


Modified:
    httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide.html.en
    httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide.xml
    httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide_advanced.html.en
    httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide_advanced.xml

Modified: httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide.html.en
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide.html.en?rev=728400&r1=728399&r2=728400&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide.html.en (original)
+++ httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide.html.en Sun Dec 21 00:08:52 2008
@@ -306,12 +306,12 @@
 
 #   first try to find it in dir1/...
 #   ...and if found stop and be happy:
-RewriteCond         %{DOCUMENT_ROOT}/<strong>dir1</strong>/%{REQUEST_FILENAME}
 -f
+RewriteCond         %{DOCUMENT_ROOT}/<strong>dir1</strong>/%{REQUEST_URI}  -f
 RewriteRule  ^(.+)  %{DOCUMENT_ROOT}/<strong>dir1</strong>/$1  [L]
 
 #   second try to find it in dir2/...
 #   ...and if found stop and be happy:
-RewriteCond         %{DOCUMENT_ROOT}/<strong>dir2</strong>/%{REQUEST_FILENAME}
 -f
+RewriteCond         %{DOCUMENT_ROOT}/<strong>dir2</strong>/%{REQUEST_URI}  -f
 RewriteRule  ^(.+)  %{DOCUMENT_ROOT}/<strong>dir2</strong>/$1  [L]
 
 #   else go on for other Alias or ScriptAlias directives,
@@ -524,6 +524,8 @@
 #   parse out basename, but remember the fact
 RewriteRule   ^(.*)\.html$              $1      [C,E=WasHTML:yes]
 #   rewrite to document.phtml if exists
+#   Note: This is a per-directory example, so %{REQUEST_FILENAME} is the full 
+#         filesystem path as already mapped by the server.
 RewriteCond   %{REQUEST_FILENAME}.phtml -f
 RewriteRule   ^(.*)$ $1.phtml                   [S=1]
 #   else reverse the previous basename cutout

Modified: httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide.xml?rev=728400&r1=728399&r2=728400&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide.xml (original)
+++ httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide.xml Sun Dec 21 00:08:52 2008
@@ -298,12 +298,12 @@
 
 #   first try to find it in dir1/...
 #   ...and if found stop and be happy:
-RewriteCond         %{DOCUMENT_ROOT}/<strong>dir1</strong>/%{REQUEST_FILENAME}
 -f
+RewriteCond         %{DOCUMENT_ROOT}/<strong>dir1</strong>/%{REQUEST_URI}  -f
 RewriteRule  ^(.+)  %{DOCUMENT_ROOT}/<strong>dir1</strong>/$1  [L]
 
 #   second try to find it in dir2/...
 #   ...and if found stop and be happy:
-RewriteCond         %{DOCUMENT_ROOT}/<strong>dir2</strong>/%{REQUEST_FILENAME}
 -f
+RewriteCond         %{DOCUMENT_ROOT}/<strong>dir2</strong>/%{REQUEST_URI}  -f
 RewriteRule  ^(.+)  %{DOCUMENT_ROOT}/<strong>dir2</strong>/$1  [L]
 
 #   else go on for other Alias or ScriptAlias directives,
@@ -517,6 +517,8 @@
 #   parse out basename, but remember the fact
 RewriteRule   ^(.*)\.html$              $1      [C,E=WasHTML:yes]
 #   rewrite to document.phtml if exists
+#   Note: This is a per-directory example, so %{REQUEST_FILENAME} is the full 
+#         filesystem path as already mapped by the server.
 RewriteCond   %{REQUEST_FILENAME}.phtml -f
 RewriteRule   ^(.*)$ $1.phtml                   [S=1]
 #   else reverse the previous basename cutout

Modified: httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide_advanced.html.en
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide_advanced.html.en?rev=728400&r1=728399&r2=728400&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide_advanced.html.en (original)
+++ httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide_advanced.html.en Sun Dec 21 00:08:52
2008
@@ -345,7 +345,7 @@
 
 <div class="example"><pre>
 RewriteEngine on
-RewriteCond   /your/docroot/%{REQUEST_FILENAME} <strong>!-f</strong>
+RewriteCond   %{DOCUMENT_ROOT/%{REQUEST_URI} <strong>!-f</strong>
 RewriteRule   ^(.+)                             http://<strong>webserverB</strong>.dom/$1
 </pre></div>
 
@@ -575,7 +575,10 @@
           through the proxy throughput feature:</p>
 
 <div class="example"><pre>
-RewriteRule ^/~([^/]+)/?(.*)          /home/$1/.www/$2
+RewriteRule ^/~([^/]+)/?(.*)          /home/$1/.www/$2 [C]
+# REQUEST_FILENAME usage below is correct in this per-server context example 
+# because the rule that references REQUEST_FILENAME is chained to a rule that
+# sets REQUEST_FILENAME. 
 RewriteCond %{REQUEST_FILENAME}       <strong>!-f</strong>
 RewriteCond %{REQUEST_FILENAME}       <strong>!-d</strong>
 RewriteRule ^/home/([^/]+)/.www/?(.*) http://<strong>www2</strong>.quux-corp.dom/~$1/pub/$2
[<strong>P</strong>]
@@ -850,6 +853,7 @@
           This is done via the following ruleset:
 
 <div class="example"><pre>
+# This example is valid in per-directory context only
 RewriteCond %{REQUEST_FILENAME}   <strong>!-s</strong>
 RewriteRule ^page\.<strong>html</strong>$          page.<strong>cgi</strong>
  [T=application/x-httpd-cgi,L]
 </pre></div>

Modified: httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide_advanced.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide_advanced.xml?rev=728400&r1=728399&r2=728400&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide_advanced.xml (original)
+++ httpd/httpd/trunk/docs/manual/rewrite/rewrite_guide_advanced.xml Sun Dec 21 00:08:52 2008
@@ -336,7 +336,7 @@
 
 <example><pre>
 RewriteEngine on
-RewriteCond   /your/docroot/%{REQUEST_FILENAME} <strong>!-f</strong>
+RewriteCond   %{DOCUMENT_ROOT/%{REQUEST_URI} <strong>!-f</strong>
 RewriteRule   ^(.+)                             http://<strong>webserverB</strong>.dom/$1
 </pre></example>
 
@@ -568,7 +568,10 @@
           through the proxy throughput feature:</p>
 
 <example><pre>
-RewriteRule ^/~([^/]+)/?(.*)          /home/$1/.www/$2
+RewriteRule ^/~([^/]+)/?(.*)          /home/$1/.www/$2 [C]
+# REQUEST_FILENAME usage below is correct in this per-server context example 
+# because the rule that references REQUEST_FILENAME is chained to a rule that
+# sets REQUEST_FILENAME. 
 RewriteCond %{REQUEST_FILENAME}       <strong>!-f</strong>
 RewriteCond %{REQUEST_FILENAME}       <strong>!-d</strong>
 RewriteRule ^/home/([^/]+)/.www/?(.*) http://<strong>www2</strong>.quux-corp.dom/~$1/pub/$2
[<strong>P</strong>]
@@ -845,6 +848,7 @@
           This is done via the following ruleset:
 
 <example><pre>
+# This example is valid in per-directory context only
 RewriteCond %{REQUEST_FILENAME}   <strong>!-s</strong>
 RewriteRule ^page\.<strong>html</strong>$          page.<strong>cgi</strong>
  [T=application/x-httpd-cgi,L]
 </pre></example>



Mime
View raw message