About this user

Kenn Christ http://www.inmostlight.org/

« Newer Snippets
Older Snippets »
2 total  XML / RSS feed 

Parse .html files as PHP

To parse files with a .html extension as PHP, add this line to httpd.conf, your VirtualHost container, or .htaccess:
AddHandler application/x-httpd-php .html

You can substitute your own arbitrary file extensions for .html if you want to use, for example, filename.foo on your site.

Disallow serving of PHP pages if mod_php is not loaded

If mod_php doesn't load for some reason, your PHP files may be served unparsed, as plain text. This presents the possibility that your database passwords or other senstive information may be visible. Adding the following to your httpd.conf, VirtualHost container, or .htaccess file will deny access to any PHP files if the PHP module is not loaded.

<IfModule !mod_php4.c>
    <FilesMatch "\.php$">
        Order allow,deny
        Deny from all
        Allow from none
    FilesMatch>
</IfModule>

« Newer Snippets
Older Snippets »
2 total  XML / RSS feed