Process php on html pages

Previously I posted about a gentle introduction to php.

To make your .htm or .html pages process like they were .php, just add this line to your .htaccess file:

AddType application/x-httpd-php .html .php .htm

Or use:

RewriteEngine On
RewriteRule ^index.html /index.php

The .htaccess directory-level configuration file can also be used for:

Custom Error Pages
Password protection
Redirects
Prevent hotlinking of images
Preventing Directory Listing

Comments are closed.