I used the htaccess maker to create the htaccess file. One of the option is to reidrect index.php to the root of the site. I used that for many years.
Now I finally updated my website from J3 to J4. But somehow in this period, Google has indexed many pages with "index.php" in the url. For example: https://www.waterpijp-bong.nl/index.php/bongs/percolator-bongs/d-smoke-stoner-hustler-bong-blue-headshop
As you can see the index.php is in that url. When loadind this URL, it loads the URL just as it is, with index.php in it. I thought that the url should rewrite to non-index.php. But it is not. What code I need to use in the .htaccess?
I just changed your lines with this code:
RewriteCond %{THE_REQUEST} ^.*/index\.php
RewriteRule ^(.*)index.php$ /$1 [R=301,L]
But this still acts the same as yours. Isit possible to rewrite the index.php in the url?