Reputation: 2668
I had an assignment of moving Joomla 1.0 content, categories and other stuff to the latest WordPress. Everything went fine, a few PHP scripts, a bit of fiddling with MySQL. But then, unexpected problem arose. I have to change permalinks to that:
$sitename/content/view/$post_id/$menu_id
The variables are from Joomla, and they have nothing to do with WordPress. I solved $menu_id
thing through post_name in DB. But now I have to change the $post_id
too, because it is exactly shifted by 44 (42'd be better though :) due to categories added first.
So finally the question: can I somehow subtract 44 from the %post_id%
I have in my permalink settings? (sth like "content/view/(%post_id% - 44)/") Or maybe a small change in the WordPress code?
Thank you.
Upvotes: 0
Views: 214
Reputation: 3232
I don't see any easy way to do what you want (apart from hacking Wordpress core which is not, IMHO, a good idea).
If you use an Apache webserver and if you don't have thousands of posts, you could write a bunch of apache rewrite rules (either in an .htaccess file or in your virtualhost file) to handle this redirection for you. A solution for a similar - but, I must admit, simpler - problem is described in this post.
Even with that solution (or hacking wordpress core), you'll face other problems, such as:
This is what come to my mind now, but I'm almost sure there will be other side-effects if you go this way because IDs are used litteraly everywhere.
It it is possible for you, I strongly suggest you do your migration process again, and keep IDs consistents with your old database. Even if it takes some times, it will really, really be easier to deal with and maintain.
Upvotes: 1