Search code examples
wordpresspermalinks

Changing Permalinks


I want to change my permalinks from /%year%/%monthnum%/%day%/%postname%/ to /%postname%/

but when I added the following to the .htaccess file, posts didn't redirect the way I thought they would:

RedirectMatch 301 /dddd/dd/dd/(.*) /$1

What do I need to put into my .htaccess file to make it work?

My site is http://SweatingTheBigStuff.com


Solution

  • I think everyone is missing the point here - I think @Daniel has changed his permalinks, and now wants to redirect old permalinks.

    The problem is your RedirectMatch regex is only matching a literal 'd', not digits.

    Personally I would use this instead;

    RedirectMatch 301 ^/[0-9]{4}/[0-9]{2}/[0-9]{2}/(.+)$ /$1
    

    However, @markratledge is right in saying that there are issues with using just the postname.