We have some wrong URLs in our store ending with .html
. If the user opens such a URL, then the .html should get removed, otherwise the site cant get found.
So I added this rule to my .htaccess file in pub/.htaccess, i also tried the normal .htaccess in the magento root.
<IfModule mod_rewrite.c>
...
############################################
## Remove .html from end of URL
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)\.html$ /$1 [L,R=302]
</IfModule>
But if I enter a URL with .html at the end, then it is still not getting removed.
I want to make it work by using the .htaccess, otherwise I will have to create plenty of URL rewrites by hand.