How to parse .html or .htm files as .php?

Yes, you can do it by the help of CloudLinux lsapi/LiteSpeed API, use the following:

AddHandler application/x-httpd-lsphp .htm .html .shtml

For other PHP Handlers, you can utilize the following:

Make a .htaccess file and transfer it to your public_html folder and add below lines:

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

Since these expansions will be prepared as PHP because of the above command, changing the permission on those file types to 755 might be required.

In case above command not working properly, you can use command as below:

AddType application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml .html .htm

or

AddType application/x-httpd-php .php5 .php4 .php .php3 .php2 .phtml .html .htm

Please enter a valid email address.

Web Hosting

Web hosting with speed, security, and stability you can trust. Built on ultra-fast NVMe SSDs, smart caching, and a global CDN to deliver fast load times worldwide. Perfect for blogs, business sites, and online stores that need room to grow.

Get Started for ₹149 only

cPanel Hosting

Enjoy seamless and affordable cPanel hosting for personal or professional websites. Easily deploy open source applications with a single click and import projects from GitHub effortlessly. Our aim is to make the process simple and hassle-free.

Get Started Today!