in reply to Convert Relative to Absolute URLs on-the-fly

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

Replies are listed 'Best First'.
Re^2: Convert Relative to Absolute URLs on-the-fly
by mjlush (Novice) on May 18, 2009 at 11:15 UTC

    Thanks!! This worked a treat!

    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 :-)