For example, to redirect old URLs of the form:
/2016/10/mukunda-murari-kannada-songs-download.html
To
/mukunda-murari-kannada-songs-download.html
I have already changed the permalink structure in WordPress, but wish to redirect the old URLs to the new, in the most efficient way, in order to help preserve SEO.
This is my code:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/.]+)/?$ $1.html [L,R=301]
RewriteRule . /index.php [L]
</IfModule>
# END WordPress