.htaccess permalink rewrite help

I need some help with an .htaccess rewrite.

I have a site that had this permalink: /archive/%post_id

and changed it to this: /%postname%/

I have tried every single permalink redirect and change plugin - none of them work for this scenario.

The site has 15,000 posts, adding one line 301 redirects in the .htaccess file isn’t going to work.

Can someone help me add a rewrite that will redirect all instances of /archive/%post_id to /%postname%/ ?

any help appreciated!

You can’t. Apache doesn’t know what id belongs to what name.
Do you have access to the main Apache config httpd.conf? If so, you can use a RewriteMap with a script that accesses the database.
If not, I’m afraid you’re only option is to code all redirects by hand. Or see if there is some WordPress plugin that can handle the redirection for you or see if there is someone that can write one for you. Or write it yourself if you know PHP :slight_smile:

AHA - got it, thanks! That means the only way to handle this kind of functionality is with a plugin!