1
I have an html site and want HTML pages to be parsed as php; I’m using a . htaccess file for this.
On the localhost server, it works correctly. The command is:
Addhandler application/x-httpd-php . html . htm
However, the online server does not work. When I access the page, it asks to download the file instead of displaying the page.
I’m using PHP 5.5 the Apache and Apache version/2.4.10 I have several php includes inside the html more so I would have to change all pages to . php more would take a lot of work so I want to leave everything with . html more running the includes but only that the code does not work on the online server
I tried all kinds of similar commands in htaccess, like:
Addtype application/x-httpd-php . html . htm
Addtype application/x-httpd-php5 . html . htm
Addhandler application/x-httpd-php . html . htm
Addhandler application/x-httpd-php5 . html . htm
Addhandler x-Mapp-php . html . htm
Addhandler x-Mapp-php5 . html . htm
but unlucky.
I also tried
- Remove . html . htm but to no avail.
I checked on the server if . htaccess is active and this tested a code and worked normal the problem is in the same code
Create a
.php
it runs normally? because it does not rename all files, likerename -S .html .php *.html
, for example.– Inkeliz