The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Problem getting .html/.shtml to parse PHP

Discussion in 'General Discussion' started by Dweezel, Sep 26, 2007.

  1. Dweezel

    Dweezel Member

    Joined:
    Sep 26, 2007
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    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.
     
  2. WebScHoLaR

    WebScHoLaR Well-Known Member

    Joined:
    Dec 14, 2005
    Messages:
    511
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Planet Earth
    What lines of code you have in your .htaccess?
     
  3. Dweezel

    Dweezel Member

    Joined:
    Sep 26, 2007
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    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.
     
  4. ManojB

    ManojB Well-Known Member

    Joined:
    Mar 25, 2005
    Messages:
    80
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    pune
    Hello Dweezel,

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

    ManojB
     
  5. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,447
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    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.
     
Loading...

Share This Page