Solving the permalink migration mystery.

1228622225000 » Tagged as: Wordpress

Ever since I switched to Wordpress from Movable Type a few months ago. I have wanted to change the permalink structure. The scheme in use was just to have the post id (padded with zeros to make it appear to be a six digit number ( "%06d" ). I wanted to change the links to the postname but the older posts should remain unchanged because they have a few incoming links and many others figure high for a few search terms.

The first plugin I looked at was Dean's Permalink migration plugin. In fact I even used it on my photoblog which doesn't get a lot of traffic. Dean's plugin will redirect (302) old permalinks to the new structure so it wasn't suited for this blog. After scratching around a bit more I came across the Advanced Permalink Migration Plugin but it wasn't working as well as I had hoped. The idea with the Advanced Permalink plugin is that you can change your structure as often as you like. You can use one scheme for a range of posts (say 1 - 1000) and something completely different for the next set (say 1001 - 1250). There is no redirection involved. Just apache URL rewrites.

Even with Dean's plugin the category links were all failing things were no different wtih the new one either. In some instances clicking on a category link took you to the first post in that category at other times it produced a 404. The only thing that never happened was the link taking you to the category page like it was supposed to.

I put it on the backburner for a while but took it out and put it under the microscope with the help of the Netbeans IDE or PHP. After a lot of debugging I found that the reason for the failure was because the plugin needed to have a 'category base' define in wp admin -> settings -> permalinks.

comments powered by Disqus