Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

.htm Extensions for php version

Discussion in 'EasyApache' started by mattc1983, Feb 27, 2019.

  1. mattc1983

    mattc1983 Registered

    Joined:
    Feb 27, 2019
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    Hi,

    I've tried searching all over for an answer to this but have failed to find anything.

    I use the .htm extension on my website, those files are php and are rendered ok using EasyApache4 which adds the line:

    # php -- BEGIN cPanel-generated handler, do not edit
    # Set the �ea-php54� package as the default �PHP� programming language.
    <IfModule mime_module>
    AddType application/x-httpd-ea-php54 .php .php5 .phtml
    </IfModule>
    # php -- END cPanel-generated handler, do not edit

    to my .htaccess file. I added .htm to this (I know it says not to edit it...) to look like this:

    # php -- BEGIN cPanel-generated handler, do not edit
    # Set the �ea-php54� package as the default �PHP� programming language.
    <IfModule mime_module>
    AddType application/x-httpd-ea-php54 .php .php5 .phtml .htm
    </IfModule>
    # php -- END cPanel-generated handler, do not edit

    Which means all works as I want it to work.

    Last night the upcp job ran on my server which ended up replacing my .htaccess file with the original

    # php -- BEGIN cPanel-generated handler, do not edit
    # Set the �ea-php54� package as the default �PHP� programming language.
    <IfModule mime_module>
    AddType application/x-httpd-ea-php54 .php .php5 .phtml
    </IfModule>
    # php -- END cPanel-generated handler, do not edit

    This then rendered all my pages as php code. Not good at all.

    My questions are

    1. Is there a better method of rendering my .htm files as php.
    2. While it says do not edit above, I cannot find anywhere that I can update the extensions to include .htm. Where can I find this? What updates the .htaccess file with this and what does it use to populate it?

    I use CPanel and WHM on a VPS.

    Thanks
     
  2. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    5,716
    Likes Received:
    436
    Trophy Points:
    233
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @mattc1983

    Part of the update to v78 was rebuilding .htaccess files with the correct AddType/handler



    You should be adding/defining these in cPanel>>Advanced>>Apache Handlers rather than modifying the .htaccess directly.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. mattc1983

    mattc1983 Registered

    Joined:
    Feb 27, 2019
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    Hi,

    I thought I had already done this (image attached). Is this not the correct method?

    Thanks

    Matt
     

    Attached Files:

    • ss.png
      ss.png
      File size:
      8.5 KB
      Views:
      3
  4. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    5,716
    Likes Received:
    436
    Trophy Points:
    233
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    You definitely have if you re-save that does it properly update the .htaccess file and if you run the update again does it overwrite it?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice