Skip to main content

WHM .htaccess add .html and .htm to AdHandler

Comments

2 comments

  • muneeb852
    To overcome this problem, I am trying a bit hacky way here, need experts to to verify if i am doing something wrong here. [CODE=apacheconf] AddHandler application/x-httpd-ea-php73 .html .htm .shtml # php -- BEGIN cPanel-generated handler, do not edit # Set the "ea-php80" package as the default "PHP" programming language. AddHandler application/x-httpd-ea-php80 .php .php8 .phtml # php -- END cPanel-generated handler, do not edit
    As cPanel only change code that is inside # php --
    tags, so i have placed a code for html types, so whenever .html or .htm page is served. it will be served via php7.3 but whenever .php is served it will be served via the chosen php version from PHP Manager. Experts, Please tell me, Will everything be alright with this ? I just want to serve .html with php and don't want cPanel to overwrite my .htaccess becasue it removes .html for handler list if i give it inside # php --
    0
  • cPRex Jurassic Moderator
    Hey there! Apache will handle multiple AddHandler lines, so that is fine. I would just caution that this will require a bit of extra maintenance as you'll want to make sure your custom value matches the PHP version set for the domain to avoid conflicts.
    0

Please sign in to leave a comment.