Run HTML as PHP in FASTCGI GoDaddy

    Recently I needed to add a bit of .php code to a client's home page but didn't want to have to change his index.html to index.php.  So, I figured it'd be easy to just add a .htaccess file and that'd be it.  One problem, the site is hosted on GoDaddy.  Aha- that's probably why you're reading this.   After attempting to figure it out on my own, using Google searches and site:Godaddy.com,  I found several suggestions but none worked.  So I called up customer support and after an hour of attempting several .htaccess commands, we had no success.   So, they sent me an About.com link and told me to read up some more on .php.  That was irritating!  

    I decided to give their customer support another chance.  So, with a freshly charged phone, I gave them a call.  They provided this code:

 

Options +ExecCGI
AddType application/x-httpd-php .php .htm .html
AddHandler x-httpd-php5 .php .htm .html

Options +ExecCGI

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

AddHandler x-httpd-php5 .php .htm .html

 

It worked.  

So, create an empty file, add the above code to it, and save it as .htaccess  

Upload it to the root directly and try out your code.  That's it. That's how easy it should have been the first time around! 😛

 

Hope this saves someone lots of time.

 

Steve

Comments are closed.