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
:
- Open the section "Site settings".
- In field "PHPfiles" add
.html
and save your changes. - Wait about 10-15 minutes and check for the problem.