One of the difficulties that arise when moving a site to a completely new address (as in a new DNS host name) as I've done, is that it is very difficult to reach out to people who visit with an RSS feed reader: either the saw the original announcement and reacted, or they didn't. (If you are reading this, you've come to the right place.)

From logs and statistics I determine I've lost a lot of readers, little wonder: either the announcement went un-noticed or it was put on the I'll-do-it-later list and got lost there. I'm hoping to get those readers back here, by playing a bit of a nasty trick.

Feed readers configured with the old URL for the RSS feed will see something like this when they poll for new articles:

The nasty bit is, that they'll see that as a "new" entry every time this site's content is generated by Jekyll.

For the time being, the old site's feed URL is being redirected to a static XML file on the new site. This redirection is quite simple to accomplish with Apache's mod_rewrite:

RewriteEngine On
RewriteRule ^feed/?([_0-9a-z-]+)?/?$ http://jpmens.net/rss.xml [R,L]

The rss.xml file is created at every Jekyll run as follows:

---
layout: nil
---
<?xml version="1.0"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Jan-Piet Mens</title>
    <link>http://jpmens.net/</link>
    <atom:link href="http://jpmens.net/rss.xml" rel="self" type="application/rss+xml" />
    <description>Jan-Piet Mens</description>
    <language>en-us</language>
    <pubDate>{{ site.time | date: "%a, %d %b %Y %H:%M:%S %Z" }}</pubDate>
    <lastBuildDate>{{ site.time | date: "%a, %d %b %Y %H:%M:%S %Z" }}</lastBuildDate>

    <item>
      <title>*** Jan-Piet Mens is moving to jpmens.net ***</title>
      <link>http://jpmens.net</link>
      <pubDate>{{ site.time | date: "%a, %d %b %Y %H:%M:%S %Z" }}</pubDate>
      <author>Jan-Piet Mens</author>
      <guid>{{ site.time }}</guid>
      <description><![CDATA[This feed has moved. Please go to <a href="http://jpmens.net">http://jpmens.net</a> and change your feed's URL to <a href="http://jpmens.net/atom.xml">http://jpmens.net/atom.xml</a>]]></description>
    </item>

  </channel> 
</rss>

Notice how I'm using site.time in the pubDate and guid elements; this inserts the system time, which is new at each Jekyll run, of course. When readers fetch the resulting RSS feed, they are tricked into thinking it's a new post and mark it as unread.

It works. The only question is, whether I'll get some of my faithful visitors back, or whether I'll piss them off for good. I hope it's the former. :-)

Flattr this
Site, Jekyll, RSS, Atom, and Feed :: 17 Jun 2011 :: e-mail

Comments

blog comments powered by Disqus