2.4.3.15. PHP code in HTML files does not work or download.php file is downloaded instead of opening the site

The problem can arise when you try to .htaccess override the files that PHP should handle, thus:

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

This construct can only be used when PHP is running in mod mode._php. PHP runs in a different mode on our servers — fastcgi, so handlers need to be redefined differently.

For PHP to additionally process files with the extension .html:

  1. Open the section "Site settings".
  2. In field "PHPfiles" add .html and save your changes.
  3. Edit the file .htaccess and delete all lines with directives from it AddType and RemoveHandler.
  4. Wait about 10-15 minutes and check for the problem.
Content