Save different versions of webpage with PHP

Save different versions of webpage  by only save the updated files. And
change the local file links into new relative links.