You can try this... I didn't test the code, but its worth a try, right? 🙂
// Load source file
$source_file = join('',"index.html");
// Replaces all href="" and src="" tags to have full path
$source_file = preg_replace("~(href|src)\=\"([\"]*)\"~","\1\=\"http://www.server.com/mydir/\2\"",$source_file);
// Display fixed HTML code
echo $source_file;
You can give something like that a try... Let me know how that works :p
-Josh