I am trying to achieve this solution of having pages served statically
by the web server. The URL rewriting is occuring, but I can't get the
server to output the file as an .html page. Is there something similar
in .php to force the output of the query to be written statically.
Thanks,
Jason
p.s. I broke my wrist recently, or I would write more
On-the-fly Content-Regeneration
Problem Description:
Here comes a really esoteric feature: Dynamically generated but
statically served pages, i.e. pages should be delivered as pur static
pages (read from the filesystem and just passed through), but they
have to be generated dynamically by the webserver if missing. This way
you can have CGI-generated pages which are statically unless one (or a
cronjob) removes the static contents. Then the contents gets
refreshed.
Problem Solution:
This is done via the following ruleset:
RewriteCond %{REQUEST_FILENAME} !-s
RewriteCond ^page\.html$ page.cgi
[T=application/x-httpd-cgi,L]
Here a request to page.html leads to a internal run of a corresponding
page.cgi if page.html is still missing or has filesize null. The trick
here is that page.cgi is a usual CGI script which (additionally to its
STDOUT) writes its output to the file page.html. Once it was run, the
server sends out the data of page.html. When the webmaster wants to
force a refresh the contents, he just removes page.html (usually done
by a cronjob).