
using htaccess to allow html pages to be parsed as php - I cannot get it to work !
Hello,
I am planning to rebuild my website with header.htm, foot.htm, menu.htm files etc and using php includes within my exisiting .html files. I have been informed that php can be parsed my html pages as php by adding a rule to the .htaccess file, and have found several codes to use, but so far have been unable to get any of them to work. They either result in a request to download and save pages rather than show in the browser, or they do nothing.
The codes I have tried are:
AddType application/x-httpd-php .htm .html
-- results in attempted download
RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html
- results in attempted download
AddType x-httpd-php .php .htm .html
AddHandler application/x-httpd-php .php .htm .html
-- prevents php being read in php file (e.g.
http://www.tranquillizer.co.uk/supplement-whey-protein.php)
and does nothing for .html file (e.g.
http://www.tranquillizer.co.uk/phptest.html)
AddType x-mapp-php4 .html .htm (suggested by web host)
results in some pages as Error 404 not found (pages for which the link has no extension I think)
My server is with 1and1, and so far they have not given a response to my problem. As a last resord I will have to rename all pages as .php and set up permanent redirects, but I have been informed that this may affect page ranking etc.
Does anyone have any suggestions? I do not have access to the Apache config files with my webhost.
If you are with 1and1 and have done this, please let me know !
Thanks,
Jon.