The set of RewriteCond statements are ANDed after the first pair or OR’s. so, if one of the first three is matched AND #4 is matched AND #5 is matched, THEN the RewriteRule is executed (actually, it’s first but, logically speaking …) and your EVERYTHING atom then captures EVERYTHING (or nothing) so your redirection is executed (without changing the query strong). Note that EVERYTHING includes all files whether .php, html, js, jpg, gif, css, yadda yadda.
[standard rant #1][indent]The use of “lazy regex,” specifically the EVERYTHING atom, (.*), and its close relatives, is the NUMBER ONE coding error of newbies BECAUSE it is “greedy.” Unless you provide an “exit” from your redirection, you will ALWAYS end up in a loop![/indent][/standard rant #1]
Now that I’ve gotten that rant out of my system, it is possible that RewriteCond #3 will cause $1 to be matched so that, as far as a URL is concerned, $3 can’t exist.
What you’ve shown is very confusing so, would you please describe what you’re trying to do?
OMG?!? After many years of null or on, it appears that {HTTPS} has been updated in Apache 2.4 [prior versions were not likely updated].
HOWEVER, historically, {HTTPS} was either null or on which led to the preferred use of the {SERVER_PORT} variable to test for either port 80 or port 443. Thus, unless you can confirm Apache 2.4, use the {SERVER_PORT} variable in your RewriteCond.