Parse HTML as PHP (htaccess way – Different Ways)

During the development tenure, most of the developers do sometimes face the challenge of assigning one file-type to be executed by some other type’s parser.

Executing HTML files as PHP is one such example. When I faced this scenario, some .htaccess handling instructions worked on one server but didn’t on another. Hence I decided to enumerate some possible variants of such commands.

Sometimes the following would suffice.

But sometimes the following.

Or just assigning the type rather than handler would suffice.

But sometimes you might have to provide the actual path to php (confirm the path from your Hosting Service provider).

Okay let me repeat! This article is meant to enumerate the variants, not describe them. Please Google for description as I am not actually interested to copy-paste the definitions & explanations over here (Atleast not this time 😉 )

Leave a Reply

Your email address will not be published. Required fields are marked *