I have redeveloped a static html site in wordpress and am trying to map previous page address to the new wordpress compatible slugs using the htaccess file.
So I have figured out how to remove the “.html” of a requested url but also need to remove the remove the final â/â.
ie change “fred/fred1/fred2.html” to become “fred/fred1fred2” …
Thanks for any suggestions…
Currently have:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} .html$
RewriteRule ^(.*).html$ $1 [R=301,L]
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
You should replace this:
by this :