重写Wordpress网址

Recently I changed my wordpress permalinks in an effort to make them more readable and inline with what other blogs have done, which is just having the postname at the end, however I am having some issues with the .htaccess required for redirecting the old permalinks back to the new ones.

The previous permalink structure I had in place is as follows:

http://domain.com/%category%/%post_id%-%postname%

Now I would like to change it to the following:

http://domain.com/%postname%

I have tried to do this with a URL Rewrite, however I am having no such luck unfortunately

RewriteRule ^/([^/]+)/(\d+)-([^/]+)/$ http://domain.com/$3 [L,R=301]

My knowledge of mod_rewrite is limited, very limited. I was wondering if anyone could help me out as to why this is happening, and what I can do to resolve it. I essentially would like it to redirect to the correct permalink, with the "Moved Permanently 301" error code (so Google doesn't get upset with me)

Thank you for any assistance

The regex looks right,
however it might be to do with the trailing slash in the URL

try:

RewriteRule ^/([^/]+)/(\d+)-([^/]+)/?$ http://domain.com/$3 [L,R=301]

That should work with or without the trailing slash in the URL

I might be wrong, but doesn't it work automatically with Wordpress? At least with posts - if you change the slug, the old slug still works but redirects to the new one with 301. Isn't it the same with permalinks - maybe you shouldn't even change anything?