As some previous commenters have noted, there is a spectrum here between full-bore rewrite and don't-touch-a-thing. Parts of the code could be factored out, modularized, rewritten in another language, and all that without huge impacts on the existing functionality. Joel Spolsky wrote an article a long time ago about the value of software that has already been written and put through its paces (though I don't agree with /never/ rewriting, it should be done only as last resort):
"The idea that new code is better than old is patently absurd. Old code has been used. It has been tested. Lots of bugs have been found, and they've been fixed. "
There's value baked into that old code: lessons learned, bugs fixed, workaround put into place. These things can be lost during a rewrite (and sure, there are other times you don't need them in the new version because the original problem has a better solution/doesn't happen in the new language/whatever), and potentially losing/missing should be considered carefully.
http://www.joelonsoftware.com/articles/fog0000000069.html
The most important part:
"The idea that new code is better than old is patently absurd. Old code has been used. It has been tested. Lots of bugs have been found, and they've been fixed. "
There's value baked into that old code: lessons learned, bugs fixed, workaround put into place. These things can be lost during a rewrite (and sure, there are other times you don't need them in the new version because the original problem has a better solution/doesn't happen in the new language/whatever), and potentially losing/missing should be considered carefully.