I\'ve been trying to get .html files to process like .PHP files, using the .htaccess file. I\'ve used the following, both of which don\'t work and trying to access the test
You need to add
AddHandler application/x-httpd-php .html .htm
You need to know whetheryou are using php-fpm instead of php module. If you are using php-fpm, then you have to do two things:
1) in httpd.conf add the lines:
<FilesMatch \.(html)$>
SetHandler "proxy:unix:/run/php-fpm/www.sock|fcgi://localhost"
</FilesMatch>
2) in php-fpm.d/www.conf make sure you have the line
security.limit_extensions =
This will work. Maybe there are better settings, I don't know. I do know that if you have php-fpm, none of the answers involving AddHandler, AddType are going to work.
Try this:
AddHandler application/x-httpd-php .html .htm
or
AddHandler x-httpd-php .html .htm
or
<FilesMatch "\.(htm|html|php)$">
SetHandler application/x-httpd-php
</FilesMatch>
or
<FilesMatch "\.(htm|html|php)$">
SetHandler application/x-httpd-php5
</FilesMatch>
Edit: For 1&1 server:
AddType x-mapp-php5 .html .htm
One of these should work
You can try the code below also.
AddHandler x-httpd-php .html .htm
OR
AddType application/x-httpd-php .html .htm