A kind of a static site with all the benefit of SE visibility and the ease of maintainent of a dynamic site.
Anyone try it out yet? I'm looking getting start on this project but I just what to check if anyone else went down this road before....weather this is worth the investigation.
Thanks.
You can have pages dynamically generated from a database and still make them look static.
Havea a look at apache's mod_rewrite [httpd.apache.org] module.
The only difference is instead of writing to STDOUT you're writing to a file.
There is only one issue you must encompass: the script must be able to write the files somewhere, usually a directory, which means your directory must be world-writable. This is dangerous for various reasons, but if you have no other option - it's the risk you'll have to take.
A very good solution:
Files written by a script are owned by Apache, which means that "everyone" also owns them. But let's say instead of writing the file, you store the content in a database, with or without a site template.
You then have a cron job, which runs as root, that extracts the data from the database and does the actual writing. In this scenario you don't **need** a world-writable directory because root owns it all. The only drawback is that you won't be able to overwrite these files from FTP. You'll just be able to delete them. Which shouldn't be a problem, right? :-)
You can set the cron to run at whatever update intervals you think you'd require, from every five minutes to once a day.
When searching, you simply search the database (lightspeed faster) and point the results to the html files instead of the database. Or what the heck - go ahead and let the results display from the database - the only real reason you need the HTML is for the search engines, and the links to the pages for them to follow. The output should be identical.
You will either have to have SSH access (or God forbid telnet) to the server to create the cron, or buy your admin lots of doughnuts to have him add the cron for you. :-)
The first is the simple method using ttree... I have the content pages in separate files, and the script runs the template on each page.
The second came out of a mod_perl engine I had written. All the information is in a database, and the templates generate pages. The script basically spiders the "site", extracting links and generates those pages.
I didn't find the latter any easier than going fully dynamic, since it took several hours to generate the pages (150K in my test). I'm currently rewriting the site in PHP&Smarty and so far I'm able to go fully dynamic (ie pages rendered on the fly) with good performance, largely due to Smarty and PHP's caching abilities.
Sean