You need to use the% {QUERY_STRING} variable inside the RewriteCond. For example, if you do not want to redirect, if there is a redirect=no line in the query line, it will look like this:
RewriteCond %{QUERY_STRING} !(^|&)redirect=no($|&) RewriteRule . /index.php [L]
So, if the RewriteCond fails (it has a redirect=no line in the query line), then do not apply the following rule, which overwrites everything that the request URI has the value /index.php . The actual rule you need may be different, but using RewriteCond and% {QUERY_STRING} is the main idea you want.
source share