|
|
.htaccess tips and tricks
Cause PHP processing on files with .htm or .html extensionNormally web-hosts configure their web-servers to do PHP processing only on files with the .php extension (or a few variations of this). To cause the server to process your file with .html or .htm extension for PHP, you need to add one of the following lines to your .htaccess file. Note that there is some confusion regarding what exactly will work. So depending on the Apache version, the PHP version and how the web-host has setup things, one of the several should work. If all else fails, call tech-support and find out how they've configured the "Action" rule for processing PHP and use that with the "AddHandler" rule below.
Note that the "AddHandler server-parsed" (to use Server-Side Includes (SSI)) will conflict with this usage (see documentation for "AddHandler"). For any given extension, the last "AddHandler" in the .htaccess file will take precedence. One way suggested by some people is to only configure Server-Side Includes and include a file with the .php extension. Supposedly this will cause the .php to execute as PHP. I haven't tried this myself.
|
Site
Links
|
Site copyright of domain owner. All rights reserved. |