I have seen some unwanted URL requests in my logs and I would like to
redirect them to the correct URL.
Incorrect URL:
http://www.example.com/type/subtype/product/index.php
Correct URL:
http://www.example.com/type/subtype/product.html
To redirect incorrect to the correct one, I thought of this:
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.+index\.php\ HTTP/
RewriteRule ^(.*)/index\.php$ http://www.example.com/$1.html? [R=301,L]
I was going to put this after individual page redirects and just above
non-www to www redirect. Could anybody check if my syntax is correct,
please?