Msg#: 4347415 posted 9:56 pm on Aug 3, 2011 (gmt 0)
htaccess rewrite to replace %3F with ?
Some scrapers/bots grab search engine results, which they then insert into their site, but search engine results contain links that are url encoded, meaning a query string ? become %3F. If a link to your site contains %3F it will result in a 404 error, as it will make the server search for a directory name ? which cannot exist. Google webmaster tools will then report errors!
Msg#: 4347415 posted 10:11 pm on Aug 3, 2011 (gmt 0)
This isn't a rewrite. This is a redirect - even though it uses a RewriteRule. Confusing isn't it?
The (.*) pattern matches the entire GET /somefile?somequery=somevalue HTTP/1.1 request. By using two (.*) patterns you are saying that you want to match "everything" into the first (.*) and then match it all again in the second one. This confuses the parser beyond belief. It then has to make tens of thousands of "back off and retry" trial matches until it discovers you only want "some" of the input in the first backreference and "some" of it in the second.
Replace the two (.*) patterns with something more specific, such as ([^\%]+) and ([^\ ]+)
If you specify [Ff] you don't need the [NC] flag to allow "any case" as you have covered both cases by using [Ff]. You could use [F] and [NC] of course.
A redirect such as this should be listed as one of the very first redirects in your list of redirects.