htaccess for render php and .htm as index

Hello,

First off, loving Cyberpanel. A pleasure to work with.

I’m migrating some sites over and I have two htaccess issues.

  1. I need to render .htm and .html files as php. I’ve tried many different variations and none of the standard solutions work.

This could save me hours of work if anyone has an idea. I’m using php 7.0 on this website.

  1. I need to have a .htm file show up as an directory index. Again, tried many of the normal methods, nothing has worked.

Any help would be greatly appreciated.

Try to look this [Tutorial] How to setup and login to OpenLiteSpeed webadmin console — CyberPanel - WebHosting Control Panel for OpenLiteSpeed

I believe you are on OpenLiteSpeed. So Apache ways of doing this will not work.

On your List Websites Page, click manage for the domain you want to do this. It will open the website launcher. There you will have vHost Conf Inside the box you will find

index  {
  useServer               0
  indexFiles              index.php, index.html
}

Now you can adjust this as per your needs.

Excellent! Thank you both. I will post back to this thread the exact steps for 1 and 2.

Cheers.

To follow up…

  1. To have .htm appear as an index – see above post.

  2. To render .htm and .html as a php page:

– install litespeed webadmin > [Tutorial] How to setup and login to OpenLiteSpeed webadmin console — CyberPanel - WebHosting Control Panel for OpenLiteSpeed

– Go to webadmin >> Virtual Hosts >> Select host to update (mag glass)

– Select “Script Handler”, then “+” Add new Rule"

– Suffixes: htm, html

– Handler Type: LiteSpeed SAPI

– Handler Name: lsphp

– Save, then click the green “Graceful Restart” button in upper right