Redirect old links after changing Permalinks

asked Dec 7, 2012 in Website Builder by SaraSX
Hello,
I have a WP site and I changed the permalinks from this :

/%year%/%month%/%day%/%post_id%
To
/%post_id%
No I want visitors to my old to be redirected to the new URL.
i found a way to Redirect the Day and name permalinks to /%postname%/
but I don’t know how to change it to work.
RedirectMatch 301 /([0-9]+)/([0-9]+)/([0-9]+)/(.*)$ http://www.mydomain.com/$4
If anyone could help I would really appreciate it.
Thanks

1 Answer

0 like 0 dislike
answered Dec 7, 2012 by expert
Try the below code, this code will look for **/anything
RedirectMatch 301 /([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)$ http://www.mydomain.com/$4
...