Rewrite URL to remap WordPress Permalink

The most efficient way to accomplish this would be to change the structure to /%postname%/ and add a 301 redirect to your .htaccess file for the old structure:

RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/(?!page/)(.+)$ http://example.com/$3

Change example.com to your domain and add the redirect above the # BEGIN WordPress directive so it won’t be removed if WordPress updates the file.

EDIT- redirect /yyyy/mm/dd/postname

RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(?!page/)(.+)$ http://example.com/$4

Leave a Comment