PHP code traditionally executes only inside files that end in .php.  On some older servers, you may have forced PHP code to execute inside HTML files by using a .htaccess directive that looked something like this:

 

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

 

The above does NOT work on GridIron because PHP is being run as FastCGI on GridIron.  In order to have HTML files run through the PHP interpreter, you can add the following 2 lines to a .htaccess file:

 

AddHandler fcgid-script .html

FcgidWrapper /yourhomedirectorypath/.fcgi/php.fcgi .html

 

You must add these two lines for each file extension (for example, .htm) that you want processed by the PHP engine (you can’t combine multiple file-types into one statement).

The easiest way to determine your home directory path is to look at the “PWD” section of phpinfo() for your website.  This will give you your home directory, including the .fcgi directory.  It will look something like this:

Environment

Variable Value
PWD /home/1/e/ex/example/.fcgi

 

 

Another alternative is to use mod_rewrite directives to transparently redirect .html requests to existing .php files.  For example, when a visitor requests a file called document.html from your site, you can use mod_rewrite to instruct the server to transparently serve up the contents of document.php instead.  You can get started with this with some examples of how to implement this here and here.