In summary place the following in a .php file somewhere, like viewsource.php or phpsrc.php:
<?phpThen add the following 2 lines to .htaccess:
$file = preg_replace("/\\.phps$\", ".php", $_SERVER[\'PATH_TRANSLATED\']);
$file = realpath($file);
if (!file_exists($file)) {
print("Error: No such file!!");
} else {
highlight_file($file);
}
?>
AddType php-source .phpsreplace viewsource.php with your file name of choice, and viola!
Action php-source /viewsource.php
For example, see the AAWC Formatter and its source.
Cheers,
Steve