Problem with .htaccess handling HTML as PHP
Posted by:
DavidB
(---.as13285.net)
Date: November 25, 2013 12:57PM
For most of my projects I have an .htaccess file with the line
AddType application/x-httpd-php .htm .html
so that .htm and .html files are processed by the server as PHP. This works fine with Wampserver, all web pages load and behave on the local host the same as they do on the live host.
However, I moved some web sites to a different host and this command no longer worked. I was advised to change the .htaccess commands to
AddHandler cgi-script .html
SetEnv PHP_EXTENSION .html
But when I create an .htaccess file with these lines and try to load the project in Wampserver, I get a 403 message
"Forbidden You don't have permission to access /DavidBoettcher.com/index.html on this server."
Removing the line "AddHandler cgi-script .html" allows the page to load, but without the PHP elements.
Any suggestions as to how I can get my projects with the second .htaccess commands to work with Wampserver would be gratefully received.
I am using Wampserver 2.2 on Windows 7.
Kind regards - David