If you want to do it programattically you should parse your rtf (is a simple text based file), convert rtf control words to html tags.
Here you can find the rtf specs
http://www.biblioscape.com/rtf15_spec.htm
or use an already existing converter: http://sourceforge.net/projects/rtf2html-lite/