Web Hosting Geeks | Web Hosting Experts
Need help? Call us 1(866)TOP-HOST

14120 reviews 1680 hosting providers

Questions & Answers

Redirect old links after changing Permalinks

Dec 7, 2012 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 votes
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