httpd-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Httpd Wiki] Update of "RewriteContext" by EricCovener
Date Wed, 05 Jan 2011 22:51:02 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Httpd Wiki" for change notification.

The "RewriteContext" page has been changed by EricCovener.
The comment on this change is: elaborate on my own RewriteBase misconception.
http://wiki.apache.org/httpd/RewriteContext?action=diff&rev1=6&rev2=7

--------------------------------------------------

  
  == Base URI ==
  
- The most visible change to look out for here is that in !VirtualHost (per-server) context
the request URI as seen by !RewriteRule will start with a / (slash). Conversely in .htaccess
or Directory (per-directory) the RewriteBase, plus a trailing slash, are stripped before the
comparison to the pattern
+ The most visible change to look out for here is that in !VirtualHost (per-server) context
the request URI as seen by !RewriteRule will start with a / (slash). Conversely in .htaccess
or Directory (per-directory) the directory containing the rules, plus a trailing slash, are
stripped before the comparison to the pattern.  
  
  As an example, consider this basic rule to map the request for 'bar' to 'baz' for a request
of /foo/bar
  
@@ -25, +25 @@

  RewriteEngine On
  RewriteRule ^/foo/bar$ %{DOCUMENT_ROOT}/foo/baz
  }}}
+ 
+ Note that !RewriteBase is used only to re-assemble relative subsitutions, not to strip the
per-directory prefix which is always the context of the rules themselves.
  
  == Environment Variables ==
  

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org


Mime
View raw message