I'm trying to make a rewrite rule that redirects only when the variable action is empty to the website index like:
RewriteCond %{REQUEST_URI} /file.php
RewriteCond %{QUERY_STRING} !^action= [NC]
RewriteRule ^([^/]+)/?$ / [L]
Access to file.php should redirect to / and file.php?action=value should not redirect.
But it's not working, what I'm doing wrong?