Url: http://yoursite.com/news/000001.html

Set up a 404 error handler:

<Directory /home/httpd/news>
    ErrorDocument 404 /generate-news.php
</Directory>

generate-news.php:

<?php
    $id 
basename($_SERVER['REDIRECT_URL'], '.html');

    
/* Generate the HTML */
    
include "/home/httpd/news/generator.php";
    
$html generate_html($data);

    
/* Show the page */
    
echo $html;

    
/* Store the page for later use */
    
$fp fopen(sprintf("/home/httpd/news/%06d.html"$id), "w");
    
fputs($fp$html);
    
fclose($fp);
? >