27th October 2004
How many of your visitors make the journey via RSS feeds? A quarter - a third - more than half - almost all? Until recently, I’d not placed a great deal of emphasis on maintaining CollyLogic‘s feeds, assuming they were important, but not vital to maintaining a high daily hits average.
Well, more fool me. A recent server swap left my URL structure slightly altered, rendering all those bookmarked feeds utterly useless. With no time to solve the problem through Apache or htaccess before a trip abroad, I was happy to ignore the issue until my return. Then I realised that my hits had decreased by approximately 85 percent!
So what do you do? Hundreds or thousands of your visitors have bookmarked your feeds in their favourite RSS readers, but those feeds - possibly the most important pages on your site - suddenly exist in a different location. How on earth do you get word to those readers that you are not dead, you are still blogging, but your URL structure has changed? Basically, unless you have them all in a mailing list, or run an alternative resource with a shared readership, you can’t. It’s gotta be a mod-rewrite manoeuvre - go with your new URL structure, but ensure you redirect to the new feeds.
For example, I needed to redirect from http://www.colly.com/index.php/weblog/rss_2.0/ to http://www.colly.com/index.php?/weblog/rss_2.0/
Create a blank file in the root directory called htaccess (if you haven’t already).
Once you’ve uploaded the file, add a ‘.’ to it’s name, creating .htaccess
Paste in the following code and save it (Note: I have inserted a line break before the http:// and URL. Best to remove that):
RewriteEngine on RewriteRule ^index.php/weblog/rss_1.0/$http://www.colly.com/index.php?/weblog/rss_1.0/ [R=301,L]
Note the old URL has no http://www (relative), but the second (new) URL is full (absolute).
Then for each new redirect, copy the RewriteRule line, and adjust the URLs.
Now, this isn’t a new method, it isn’t entirely concocted by me, and it won’t get me a book deal. I’m flagging up this code because I feel there are far too many confusing mod rewrite methods out there, and for the most part, web builders simply need a straightforward method of safely redirecting to another page. In my opinion, this method is wonderfully easy, and will undoubtedly get you out of a sticky hole at some point. Maybe another site attempted to link to your killer CSS tip, but buggered up the URL. No problem, just redirect their visitors from the duff URL to the correct one.
Incidentally, The reason this happened after switching to Media Temple is almost certainly due to a change in Apache versions. Apache 1.x was more ‘lax’ on the CGI PATH_INFO/PATH_TRANSLATED specification, while Apache 2.x (on our MT server) is now conforming to the specification correctly.
If I decide to revert back, what I need to do is to make Apache 2.x use the old style PATH_INFO specification that Apache 1.x did. Huge thanks to David at MT for the info, and a full set of instructions detailing how to do it. If anyone wants the info, just email me. Gotta say, so far MT have been fantastic, and the customer support has been excellent. Good work, nerds…
# Emeric responded on 27th October 2004 with...
That’s very interesting and useful, but it raises another question to me : is it possible to evaluate the traffic generated by RSS ? I can’t find anything about RSS stats.
How many users registered ? How many visitors on the site are coming from a RSS reader ?
As the users can configurate the frequency they check the updates, I can’t understand how I can get interesting and valid statistiques. I think RSS has still a lot to do in this way, and I would very so glad to learn more about it.
# Simon Collison responded on 27th October 2004 with...
My CMS pumps out hit stats for each of my templates, so luckily I can see how many times each feed gets accessed. I suppose the best way is to add a specific page hits counter to the feed pages. I also remember some kind of web-based RSS feed manager that lets you submit feeds and get results about each - who’s using them etc. Sorry I can’t remember what it was called. Anyone remember?
# Jeremy Flint responded on 27th October 2004 with...
Judging traffic to an RSS feed is somewhat tricky. Until recently, my RSS feed was getting twice, mabye even three times, the amount of traffic that my homepage was getting.
Thing is, rss feeds can get hit multiple times in a day if someone is just leaving their RSS reader open or has it set to a high refresh rate. Because of that, I would think that stats for RSS pages are slightly skewed.
Here is a question that I am unsure about. When a newsreader hits an RSS file that it is subscribed to, does that count as a hit/view on the RSS file, or is it only counted if the RSS actually has new content and is downloaded?
# Jonathan Snook responded on 27th October 2004 with...
What I did instead of the rewrite is to have the rss feed at the old location store a single entry which tells people that the RSS feed has moved. That way, it gives them time to update their aggregators. After an acceptable time, put in the redirect.
# Simon Collison responded on 27th October 2004 with...
Jonathan: Ah, but there were no feeds at the old locations in my case - nothing could exist there due to the URL structure. To falsify it, I would have had to create a directory with a filename-style name (such as index.php) which is impossible - I think. Still, in your case your method makes perfect sense.
Jeremy: I reckon you’re right. All those newsreader refreshes must be registering as hits. I’ve got some clever cache-ing stuff going on in my feeds (they are only dynamic when they sense a new post in the system).
And, I’d love to think that the ‘hit’ from the newsreader only registered when the user clicked the headline, but I’m sure it’s nowhere near that accurate.
# Emeric responded on 28th October 2004 with...
I have thought about the “stats” problem all the evening, and made a few test on my site. Here’s what comes from that :
> I added a PHP/SQL query in the code that increment a value
Result: each time the reader checked for new content (manually or automatically), the value increased. (So, Jeremy, the answer seems to be definitively the first prop.)
Then, I thought even deeply and try something weird, “just to see”:
> I added a PHP session variable, and then asked to increase the previous value only if the session was created.
[For those who don’t know what a “session” is : it is a kind of cookie >> a variable which you can give a lifetime).
Result: Well, I still have to make some tests, but it seems to work!!! I was very surprised, but if it works (readers “understand” sessions), I guess it is possible to know how many users are registered.
I search on Google and found nothing about this… I don’t feel like a pioneer, so I guess there’s something behind…
# Christian Watson responded on 9th November 2004 with...
Re. the stats question, I just switched to Feedburner for my feed as they provide quite detailed stats information about your RSS traffic.
You can find out a lot of stuff, including click throughs, which is quite helpful.
I still have to redirect my old RSS feed - being lazy I just asked people to update their feeds - but now that I have this nice article to refer to, I shall do so shortly.
Responses are now disabled Your ability to respond is disabled automatically some 30 days after articles are published, or manually much sooner if spamming guttersnipes target a particular article.
Archived in Design & Web
This post's Short URL is http://col.ly/s/310
There are 7 responses
Copyright © Mr. Simon Collison 2003-2010. Protected and licensed under a Creative Commons License. Grab the RSS feed
Engineered in Nottingham, scaffolded by ExpressionEngine, steam-pumped by United & kept alive with tea and roll-ups.