A few years ago this was the permalink structure I had for my blog:
/%year%/%category%/%postname%.html
I changed these permalinks last year to this:
/%category%/%postname%/%post_id%/
A plugin that goes by the name Permalinks Redirect was used, and it worked pretty well to permanently redirect older URLs to newer ones. However, after a recent WordPress update to 3.4.1 version, I noticed the older permalinks are no longer redirecting.
The problem is not with the plugin — I have spent 2 days dabbling with every redirect plugin I could find. After a bit of Googling, I figured out the problem is with WordPress 3.4, and a bug has been already submitted.
All the older URLs are throwing out 404 errors, which is frustrating. I’d really appreciate if there’s a HTACCESS redirect code, or MOD_REWRITE code (the site is using nginx, if that helps) that could be posted here.
I have very little knowledge about redirection.
You can try this but not 100% sure it will work since the post_id is not in the original permalink structure.
RedirectMatch 301 ^/([0-9]{4})/([^/]+)/([^/]+).html$ http://domain.com/$2/$3/
First of all how are you possibly using mod_rewrite rules in an nginx powered site? That’s a neat trick I’d like to learn 🙂
Anyway if you are using Apache try this:
The above uses the post’s slug instead of the ID (which is missing in the old URLs). WP should redirect again to your SE friendly URLs.