From pMachine to WordPress: Addendum regarding URL rewriting

Posted by Pierre Igot in: Blogging
July 24th, 2005 • 4:29 pm

Last week I posted a lengthy article about the steps I took to ensure that links to my older server with my old pMachine blog entries would be automatically redirected to the new site.

I’ve since discovered that I forgot one category of URLs that need to be redirected as well. (I discovered this by taking a look at my log on the old server and seeing URLs that I hadn’t thought of.)

This category includes URLs such as:

http://www.latext.com/pm/betalogue/0/
http://www.latext.com/pm/betalogue/15/
http://www.latext.com/pm/betalogue/30/

What are those, exactly? Well, they are the URLs used by pMachine to jump from page to page (i.e. for the “Previous” and “Next” links at the bottom of a page of entries). The reason that they have a number that’s a multiple of 15 in my case is that my blog was configured to display 15 entries per page.

The problem with these URLs is that they don’t refer to anything specific. Their reference point is the last entry posted, and they go backwards from there, by batches of 15 entries. So the contents of these pages is effectively dynamic and unpredictable, even for older entries, because the division into batches of 15 entries starts, not from the very first entry, but from the very last.

For example, if I currently have 1595 entries in my blog, the page with “/0” in the URL will contain entries #1581 to 1595, the page with “/15” in the URL will contain entries #1966 to 1580, and so on. But as soon as I add another entry to the blog, everything gets reshuffled.

In other words, there was no point in trying to redirect such pMachine URLs to any specific WordPress URLs. All I did was that I wrote a rewrite rule that would simply redirect such pages to the new home page:

RewriteCond %{PATH_INFO} /([0-9]+) [NC]
RewriteRule betalogue https://www.betalogue.com/ [R=301,L]

Please note that this rule looks very similar to an existing one referred to in my previous post, i.e.

RewriteCond %{PATH_INFO} /([0-9]+)_0 [NC]
RewriteRule comments https://www.betalogue.com/?p=%1 [R=301,L]

But fortunately, there’s actually no overlap, because there is no possible confusion between the two kinds of URLs. The former all have “betalogue” in the path, whereas the latter all have “comments” in their path instead.

While I was at it, I also added a few rules regarding really old URLs referring to the blogging system I used before pMachine, i.e. Radio UserLand. (Those were the days!) I find it hard to believe, but I still get a number of hits every month on the RSS feed for that old blog, even though that feed hasn’t been updated in years and its very last entry clearly says, “Betalogue has moved!” and provides instructions to update one’s bookmarks.

I guess some people still have the subscription to the old feed in their massive collection of newsfeeds and simply have never bothered to delete or update it. And of course their news aggregator keeps religiously checking it, even though it hasn’t changed in years.

Well, now, the address of the feed automatically redirects people to the new feed, so they might be surprised to discovered that their “Betalogue” newsfeed that has been dead for years has come back to life!


Comments are closed.

Leave a Reply

Comments are closed.