Problem getting .html/.shtml to parse PHP

Dweezel

Member
Sep 26, 2007
7
0
51
I've been with a new hosting provider for a few weeks and have run into problems already. I need all .shtml and .html pages to parse PHP scripts. With previous hosts this has been a very simple task. Two little lines of code in the .htaccess file and it's job done.

With my new host, changing the .htaccess file had no effect whatsoever. I emailed technical support and a guy made some configuration changes (not sure what they were). The upshot of the changes he made is that the PHP code is still not being parsed in .html/.shtml files, and now the SSI in the .shtml pages isn't working either (not a problem if the PHP is parsing, but it isn't).

I emailed them back and the response I got was that they were not prepared to do any more troubleshooting for me unless I bought a rather expensive support package from them. The only advice that they would give me is to go to the cpanel fourm and ask for advice. So here I am.

I hope this is posted in the correct section. If anyone has any advice on how I can go about getting my .html and .shtml pages to parse PHP using configuration changes via CPanel instead of editing the .htaccess I'd be very grateful.

TIA,

Chris.
 

Dweezel

Member
Sep 26, 2007
7
0
51
After registering and posting I've found the soloution to the problem myself. It was indeed a problem with the edits to the .htaccess file.

The code I'm now using is:

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


Thanks for replying Webscholar.
 

ManojB

Well-Known Member
Mar 25, 2005
80
0
156
pune
Hello Dweezel,

I was facing the same problem, thank you for the solution :)

ManojB
 

Infopro

Well-Known Member
May 20, 2003
17,075
524
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
After registering and posting I've found the soloution to the problem myself. It was indeed a problem with the edits to the .htaccess file.

The code I'm now using is:

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


Thanks for replying Webscholar.
This link http://rssfeedreader.com/php.html#HTML concerns rss feeds but explains with images how to edit your htaccess file from within cPanel to add apache handlers.