I have a website like www.website.com/index.php which is the homepage.
I select the different product with several parameters, example www.website.com/index.php?id=xxx or www.website.com/index.php?cat=xxxx
I have several lines in my htaccess to redirect the query. For example, for the products I use the following code:
RewriteCond %{THE_REQUEST} \s/+index\.php\?id=([^\s&]+) [NC]
RewriteRule ^ /product/%1? [R=301,L,NE]
RewriteRule ^product/([\w-]+)/?$ index.php?id=$1 [L,QSA,NC]
that works fine.
Now I would like to redirect to the domain root the requests to index.php that do not have any parameters, so www.website.com/index.php should become www.website.com. Any other query should not be affected. How can I do it ?
That should do the job.