I have been hosting my sites or blogs on Virtual Private Servers (VPS) since 2003 or so. I thought that a Unix guy like me should eat his own dogfood and do sysadmin on his own server. And, I’ve been planning to run my own apps – Rails, Java, etc.
But that didn’t happen. I am still doing my own personal R&D, but in its current iteration it does not need a public-facing website. It all lives inside my PC.
So, to cut costs and save time (yet another server to update and check), I canceled my VPS. I still want paraz.com content to be visible and searchable, so I migrated it here to wordpress.com. But, I was using a custom permalink structure – my preference, which is /POST-ID/post-slug. wordpress.com uses the default date-based scheme.
Therefore, I had to make my own redirect. The post slugs are the same, but WordPress has no “search by post slug” query. I had to make a 1:1 mapping for each post. I did this by performing an XML export on both blogs, then writing a small Python script to parse the XML and do the matching. The output is a flat file with the old URI on the left and the wordpress.com URL on the right. This is used by a RewriteRule which looks for a match and issues a HTTP 301 redirect.
The effect now: people who click on my old URLs from a search engin, or from a link, will land here in wordpress.com.
The effect later: The new URLs should replace the old URLs in the search engine results.