FAQ Categories

Ask A Question

Question to be answered.
Longer question text.

WWW Resources

Hosted by WestHost

How can I force .html and htm files to be processed by PHP?

In WH 4.0 you can use Advanced > Apache Handlers in cPanel to allow .html or .htm pages to be treated or processed by PHP.

Actually the Apache Handler interface is simply adding a .htaccess file to your public_html directory much like you would have done in WH 3.0 manually. The one thing that can catch you up though is which handler to use. By default an account is set up to use PHP5 so the correct handler to use would be application/x-httpd-php5. If for some reason you want to process them with PHP4 then simply use application/x-httpd-php4.

The choice of handlers here is not dependent on what you have set under Software/Services > PHP Configuration as your account PHP preference. In fact if you wanted to run all your .php files under PHP 5 you could choose version 5 as your account PHP preference and then run any older code that perhaps is not compliant with PHP 5 using the .php4 extension and set up a application/x-httpd-php4 handler for .php4 files.

Powered by Drupal, an open source content management system