However, in my experience (per-directory .htaccess files) the & and ? characters are not percent-encoded and the NE flag is not necessary in this case!? Is the manual wrong, or am I missing something? The following works OK for me:
The example given in the manual uses a # (fragment identifier) and yes, this would normally be encoded, so the NE flag would be required in this instance. So, I agree with their example, but not with the statement before it and it's bugging me!?
Msg#: 4623415 posted 1:58 am on Nov 15, 2013 (gmt 0)
RewriteRule ^/anchor/(.+) /bigpage.html#$1 [NE,R]
How 'bout the R instead of R=301 and the lack of full protocol-plus-domain in target? ;) An awful lot of Apache docs seem to involve "do as we say, not as we do".
The significant thing about # is that it has to be recognized by the browser in that form. If the browser gets a redirect response containing %23 it thinks that's just part of the URL it was supposed to ask for.
:: detour to test site ::
One place it can make a difference is if the query string contains literal question marks. Without [NE], all question marks after the first one (the query-string delimiter) turn into %3f. Frankly I can't figure out how to force escaping of & and = though. Putting = or & into the path-- with or without [NE] makes no difference-- has interesting consequences.
... and that's why people have test sites. You need to be able to play around without fear of making the server explode. Admittedly it would have been better if I kept careful notes so I could match browser's address bar with logged requests.