First, I'm trying to add a query param of i=jplx onto any uri that references an image.
And in the first two tests below it is working as expected.
However, when I try to add commands that would both add the i=jplx param plus convert the uri to pass as a param (index.php?q=system/files/&i=jplx) the next two tests (3 and 4) don't return as expected.
I've been using this for testing: https://htaccess.madewithlove.be
Any ideas on what I have wrong in the htaccess commands?
Test 1
https://some.com/sites/default/files/Slide074.png
RewriteCond %{REQUEST_URI} \.(gif|jpg|jpeg|png)$
RewriteRule ^(.*)$ $1?i=jplx [QSA]
Result 1 - as expected
https://some.com/sites/default/files/Slide074.png?i=jplx
...
Test 2
https://some.com/sites/default/files/Slide074.png?abc
RewriteCond %{REQUEST_URI} \.(gif|jpg|jpeg|png)$
RewriteRule ^(.*)$ $1?i=jplx [QSA]
Result 2 - as expected
https://some.com/sites/default/files/Slide074.png?i=jplx&abc
...
Test 3
https://some.com/sites/default/files/Slide074.png
RewriteCond %{REQUEST_URI} \.(gif|jpg|jpeg|png)$
RewriteRule ^(.*)$ $1?i=jplx [QSA]
RewriteCond %{REQUEST_URI} !^/sites/default/files/js/
RewriteCond %{REQUEST_URI} !^/sites/default/files/css/
RewriteRule ^sites/default/files/(.*)$ index.php?q=system/files/$1 [L,QSA]
Result 3
https://some.com/index.php?q=system/files/Slide074.png
Expected 3
https://some.com/index.php?q=system/files/Slide074.png&i=jplx
...
Test 4
https://some.com/sites/default/files/Slide074.png?abc
RewriteCond %{REQUEST_URI} \.(gif|jpg|jpeg|png)$
RewriteRule ^(.*)$ $1?i=jplx [QSA]
RewriteCond %{REQUEST_URI} !^/sites/default/files/js/
RewriteCond %{REQUEST_URI} !^/sites/default/files/css/
RewriteRule ^sites/default/files/(.*)$ index.php?q=system/files/$1 [L,QSA]
Result 4
https://some.com/index.php?q=system/files/Slide074.png&abc
Expected 4
https://some.com/index.php?q=system/files/Slide074.png&i=jplx&abc