.htaccess on local WAMP sevrer


I have a .htaccessfile that contains;

RemoveHandler .html .htm
AddType application/x-httpd-php5 .php .htm .html

in order parse PHP in my HTML files. So I don’t have to change all the file extensions from .html to .php. This works well on the live server that the site is hosted on. But not at all on WAMP.

I have more work to do on the site and so uploaded the .htaccess to the root folder on my WAMP server running locally on my machine.

It doesn’t seem to do anything and so none of the PHP is being read in the HTML files and so making it impossible to accurately edit, view and test the site on my local machine.

I’ve read a bunch of posts on th WAMP forum and some more here but I still don’t get why the .htaccess is being ignored by what is essentially an Apache server.

Grateful for any help.

Have you thought about using mod_rewrite instead? I don’t know how complicated your site is, but a simple solution may be:

RewriteEngine On

RewriteRule ^(.*)\.html?$ $1.php

From what I can see WAMP uses application/x-httpd-php as handler instead of application/x-httpd-php5
At least it does on my machine (WampServer 2.1)

(AFAIK application/x-httpd-php5 is mostly used by hosts that run php4 and php5 in parallel on one server, where application/x-httpd-php is the handler for php4 and application/x-httpd-php5 is the handler for php5).