Note: the following will not work on all server configurations, which may be why you’re using SSI in the first place. Call your server administrator/tech support and see if the following techniques are supported.
Escape static HTML
If you want the power and flexibility of PHP but don’t want to (or can’t) shift away from HTML, you can actually tell your server to read all HTML files as PHP by making one simple change to a file called .htaccess.
- Create a file called .htaccess if you don’t have one already, and save it to your root folder
- Add one of the following pieces of code into your .htaccess file. Depending on your server configuration, one or the other should work…you’ll just have to try them out to see which one works for you:
AddType application/x-httpd-php .php .htmlor
AddHandler x-mapp-php4 .html .htm(thanks to Florent V. below) or
AddHandler x-mapp-php5 .html .htm
- Save the file and upload it to your server.
Now, you’re able to use all of PHP’s goodness by adding one line of code!
GoDaddy-hosted websites should use
AddHandler x-httpd-php5 .php .shtml .html .htm instead.