Instead of modifying the relative URLs everywhere, wouldn't it be better to just add a <base href="http://base.url/here/"/> tag in the html <head> section?
You could do it either using a regex (just add it before the </head>) or parse the html and add it.
If you want to improve, be content to be thought foolish and stupid. -- Epictetus
Comment on Re: Convert Relative to Absolute URLs on-the-fly
To get here I'd tried Google search terms like 'fill in URL', 'fill in hostname site or sitename' and 'html as the browser shows it', with a little luck saying this may help some other benighted soul to this page :-)