The goal - remove query string and redirect to parent url if QS doesn't meet some criteria. So, as an example this url with wrong QS:
https://www.example.com/view.php?id=qqq
Should be redirect to:
https://www.example.com/view.php
So far I have this:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^(?!(mk=[1-9][0-9]{0,1}|id=[1-9][0-9]{0,3})$).*$
RewriteRule ^view\.php$ view.php? [L,R]
But it doesn't work, either reports on 403 error, or 500 Internal Server error, or too many redirects, or no site CSS loads etc. while checking it in WAMP.
I tried this also:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^(?!(mk=[1-9][0-9]{0,1}|id=[1-9][0-9]{0,3})$).*$
RewriteRule ^view\.php$ - [L]
It redirects well, but doesn't remove query string. Tried with QSD flag too.
Please, help.