The "classic" explanation I was always taught at school for the appendix was that it probably once had a purpose and may have assisted with the digestion of cellulose, but is now just a redundant feature.
However, some sources now seem to imply it does have a purpose, albeit a minor one - but these sources seem to disagree as to what this purpose is. Here's another which takes a different standpoint.
Is there a general scientific consensus on this?