Here's my .htaccess for db.etree.org:
<Files bp>
ForceType application/x-httpd-php
</Files>
<Files wap>
ForceType application/x-httpd-php
</Files>
<Files shncirc>
ForceType application/x-httpd-php
</Files>
ErrorDocument 404 /myshows.php
php_value auto_prepend_file "/var/www/projects/phplib/prepend.php3"
php_value include_path ".:/var/www/projects/phplib:/var/www/projects/db/include/"
Or a much cooloer way which sets the include path dynamicly based on unix or windows then does the prepend file but this method requires you to include this file before anything else in all your scripts:
$we_root = $HTTP_SERVER_VARS["DOCUMENT_ROOT"] . '/..';
$delimiter = (strstr($HTTP_ENV_VARS["OS"], 'indows')) ? ';': ':';
ini_set('include_path', ".$delimiter$we_root/phplib$delimiter$we_root/include");
// Path to .ihtml files
define("TEMPLATE_DIR", "$we_root/ihtml"); ## No trailing /
include 'prepend.php3';
This method assumes this direcotry structure:
PROJECT/ihtml
PROJECT/html
PROJECT/phplib
PROJECT/include
I put it in a set_enviornment.php file then each file in my project begins:
include('set_enviornment.php');
If you're interested in cool template stuff, check out the source link from my main page at http://db.etree.org