Ok. Here is the deal. These rewrite things are wonky to write. They seem to have some variability depending on the server. So, rather than weed through a ton of posts that do not appear to be the same, I’m just going to ask for help. Hopefully the question will be useful to others…
That’s a problem with the Apache installation which may have been induced by the internal absolute redirection. I get that on my test server once in a while and merely restart Apache. However, on a shared server, it’s not likely that you can get the host to reset so work on that leading / in the redirection.
The second problem is with the RewriteBase as it’s designed to UNDO a mod_alias redirection and WILL cause problems if used indiscriminately. This is the case here, too.
The third problem (mine), is that I have no clue what you’re trying to do with
RewriteEngine on
RewriteBase /apache_rewrite/a
RewriteCond %{REQUEST_URI} ^(.*)$
# this is ALWAYS true (but does nothing for you)
RewriteRule ^/([a-z/.]+)$ /b/$1 [R=301,L]
# that should loop adding b/ with each loop execution
This appears to have been the case here. I’ve let this project sit for a few days. Apache must have reset, because its working now as written.
so work on that leading / in the redirection.
I don’t understand what you are suggesting–a way to circumvent the need to restart Apache?
The second problem is with the RewriteBase as it’s designed to UNDO a mod_alias redirection…
I don’t understand this. Are you saying RewriteRule is by default mod_alias?
The third problem (mine), is that I have no clue what you’re trying to do …
I’m just testing what the RewriteBase can do. Taking a page from you own excellent Apache mod_rewrite tutorials, I created several directories with inter-linked files to first test mod_rewrite was working, and then test RewriteBase. Overall a success really.
Would you care to offer any advice to limiting the application of tests only to a designated testing directory? You commented to the line: “RewriteCond %{REQUEST_URI} ^(.*)$” this is always true. Thus, this does noting to limit the conditional rule to the testing directory. Yet I assumed having the dot-htaccess file located in the testing directory would limit the rules to only the test-directory and its sub-directories.
is there anything else I can do to set up an environment to test Apache’s mod_rewrite rules?