
Originally Posted by
lostcommander
Clearly, from my short experience with this, you are correct that this is tricky. I am really confused as to WHY it is tricky though. I included the [L] "Last" flag on the last rule, so it should make the second change and then STOP, shouldn't it? However, it instead presents my browser with a 302 Found - Error.
The [L] is working just fine. Rewriting stops, the redirect (you probably want a 301, not a 302) is sent to the browser, which requests the new page. The 'moola_cms/' is then prefixed to the URI by the 2nd RewriteRule, as it should. The problem is internal redirects.
Other modules (such as mod_index, which turns a 'foo/' URL into a 'foo/index.php' URL) cause an internal redirect, which causes another round of rewrites. The trick is in preventing rewrite on the internal redirect (or preventing the internal redirect). RewriteRules have an [NS] flag to prevent rewrites on internal sub-request, but that's different from an internal redirect. If you find a way to prevent the internal redirect, you will probably have further problems.

Originally Posted by
lostcommander
I am currently toying with RewriteCond to see if I can make the last rule not trigger more than once. I am having trouble figuring out exactly what %{REQUEST_URI} is though. Obviously, if no rewrite rules have been triggered yet, it is simply the URL starting after .tld/ and if the only rewrite rules that have been triggered have [R] "Redirect", then I would expect those changes to be represented. However, if a rewrite rule without [R] triggers, are it's changes made to %{REQUEST_URI}?
No. REQUEST_URI is "[t]he resource requested in the HTTP request line", according to the documentation. It is not altered by the rewrite rules.

Originally Posted by
lostcommander
The path to the resource the request is asking for has been changed, but the request itself has not, so I would guess that the variable does not change, but I have no way of knowing as I have no way to simply print out the variable's value to view it and find out.
You could use a RewriteCond to capture the value of REQUEST_URI and add it to the query string.
Code:
RewriteRule ^/?nonexistent/(.*) /$1
RewriteCond %{REQUEST_URI} (.*)
RewriteRule (.*) $1?olduri=%1 [QSA]
This is untested, but you should be able to request "/nonexistent/echo.php", where "echo.php" echos (at the very least) $_GET.

Originally Posted by
lostcommander
I have also tried using RewriteCond using a backreference to the rewrite rule below it. This also throws a 302 Found - Error at me and the link is to the same URL address I began with and either does nothing or returns the same when I click it.
Code:
RewriteRule ^moola_cms/(.*)$ $1 [R]
RewriteCond $1 !^moola_cms/.*$
RewriteRule ^(.*)$ moola_cms/$1 [L]
This will still have problems with internal redirects.