Assuming you have changed your permalinks in WordPress (under Settings > Permalinks), as mentioned earlier, then you can redirect your old URLs en masse (in order to preserve SEO) with something like the following at the top of your .htaccess
file, using mod_rewrite:
RewriteRule ^([\w-]+)-\d{7,}\.html$ /$1/ [R=302,L]
This will redirect URLs of the form /%postname%-%monthnum%%year%%post_id%.html
to /%postname%/
, assuming your post name is limited to the characters A-Z
, a-z
, 0-9
, _
, -
.
As noted above, this must go before your WordPress front-controller (ie. before the # BEGIN WordPress
section), at the top of your .htaccess
file.
Note also, that this is currently a temporary (302) redirect. Change the 302
to 301
(permanent) only once you have tested that this is working OK. This is to avoid any problems with browser caching.