(.*[\/])
Excuse me. Did I leave that cold compress lying around somewhere? I'm going to need it again.
Directory slashes never need to be escaped in mod_rewrite; it's doubly unnecessary within grouping brackets. And triply unnecessary when the brackets only contain one thing so you don't even need the brackets!
You say "blocks which follow this general structure" so let's see if we can extrapolate from this particular example.
The quoted group of four rules all seem to be intended to do the same thing: If the request contains the element "/search" then rewrite to index.php?arg=search/index.html
The target should have a leading slash:
/index.php et cetera
Now, I'm not going to tell you how to write your php
:: pause here for massive sighs of relief from assorted quarters ::
but is that whole query string really necessary? I assume the php is doing something based on the premise that the requested page was /search/index.html ... but the requested page never IS /search/index.html because any request ending in "index.html" has already been redirected. It should have been the second-to-last redirect ([R=301,L] flag) within the RewriteRule group.
External redirects come before internal rewrites. And then the pattern:
search?$ means "the request ends in 'search' or in 'searc'". Possibly the person who wrote the RewriteRule thought this is how you say "there might be a query string here". Not so: the body of a rule sees only the path. So that's two of four rules out the window, leaving
RewriteRule ^(.*/)search/?$
and
RewriteRule ^search/?$
Do you have any directories whose name ends in "search" but contains other text? If not, the whole package boils down to
RewriteRule search/?$ /index.php et cetera.
If you
do need to exclude longer constructs containing the literal text "search" you can constrain it to
RewriteRule (^|/)search/?$ et cetera
But now there's another basic principle to bring up: When a rule creates a redirect, it is sometimes appropriate or at least acceptable to throw in variations, like an optional "index.html" or the [NC] flag. When you're rewriting alone, the pattern has to have exactly one form, because the URL will not change again. (This is assuming it's a simple rewrite and the php is not going to end up issuing a 301 redirect.) Even after eliminating the "searc" booboos, you've still got both
/search/
and
/other-directories-here/search/
The rule doesn't include any provision for testing whether those outer directories actually exist. The php can't do it, because it hasn't been given the information. (I have to assume the php page doesn't test where you were redirected from, because if so, what's the query string for?) Under what circumstances would a request for /foobar/search/ or /widget/search/ come in? If there are careless internal links, fix them. If there are external links, redirect them as
RewriteCond %{REQUEST_URI} !/search/
RewriteRule /search/ http://www.example.com/search/
To answer the original question: There is nothing in this group of rules-- or any other similarly constructed group-- that would prevent a 301 redirect from happening. UNLESS #1 the rules creating the redirect come after the rules creating internal rewrites AND #2 the pattern for one of these RewriteRules happens to contain the same literal text as the URLs you want to redirect. Or, of course, something in that "common exploits" pattern matches your intended redirects. This does not seem likely :)