According to http://httpd.apache.org/docs/trunk/en/mod/mod_rewrite.html#rewriterule When using the rewrite engine in .htaccess files the per-directory prefix (which always is the same for a specific directory) is automatically removed for the RewriteRule pattern matching and automatically added after any relative (not starting with a slash or protocol name) substitution encounters the end of a rule set. See the RewriteBase directive for more information regarding what prefix will be added back to relative substitions. First, what this says about re-adding the prefix is unclear. The addition is said to happen when any relative substitution encounters the end of a rule set. But when does a substitution encouter the end of a rule set? The substitution is described as a string, not as a process. Second, I am not sure what the per-directory prefix would be, but for sure, it is not always the same for a certain directory. For example, suppose /var/www/computers/software/servers/httpd/doc/ is a documentation directory. An alias to that directory is created: Alias /htdoc /var/www/computers/software/servers/httpd/doc Therefore, the documentation directory is accessible through either http://example.com/htdoc/ or http://example.com/computers/software/servers/httpd/doc/ Suppose we access index.html. The rewrite rules patterns would normally match /htdoc/index.html and /computers/software/servers/httpd/doc/index.html But they actually match "index.html" in both cases. This would mean that when accessing index.html via the document root, the per-directory prefix of /var/www/computers/software/servers/httpd/doc would be /computers/software/servers/httpd/doc/. But when accessing via the alias, its prefix would be /htdoc/. Note typo "substition" (appears once more later in the section).
This ticket addresses three separate issues. The typos have been fixed. Your "First" section, I'm not entirely sure what you are asking. I think that perhaps the term "rule set" should be phased out of use, as there is no such thing. There is a rule, and optionally accompanying RewriteConds. I suppose that's what's meant by a "ruleset" In your "Second", you describe a situation that shouldn't happen. But, yes, if it does, the "per-directory prefix" would differ between those scenarios, in exactly the manner that you describe, which, I believe, is clear from the documentation. I'm not clear what change you are asking for. Can you suggest alternate phrasing?
I've updated the phrasing in r1334159 to address these concerns.
Actually, no. Reverting and reopening. What I changed it to was inaccurate.
Hi Rich, thanks for the typo fixes. Regarding the first point, I cannot say how to fix the issue. Ultimately, the reason I'm filing this is that I want to understand the purpose of RewriteBase and how it works. All I can say is that either the documentation should not refer to a substitution encoutering the end of a rule set, or it should be clarified when that happens, by specifying what is considered as a substitution and as a rule set. Regarding the second point, why should the situation I described not happen? My problem is that what "the per-directory prefix" is is unclear, and even misleading as it currently stands.
Phrasing clarified in r1755361 (trunk) and r1755363 (2.4)