I'm trying to hide the fact I'm using PHP on one of my site pages and I'm wanting to run it through the PHP parser (just that page not them all) so I can call it filename.html as usual. I have tried a few Apache directives I found online and have a few in my .htaccess file (hotlinks and for a 404 page).
When i use one of the scripts (in my .htacess) for the PHP purpose, the page wants to be saved/downloaded (like a vcard does) and a box shows - with no page to view. Can anyone please help. I'm new to PHP but believe a module might be needed or that it could be to do with the config of my server.
There is no real need to hide the fact that you are using PHP, but if you really want to parse PHP in html files you need to edit your Apache httpd.conf file. Open it up in a text editor and find a group of lines that looks like this:-
(Yours may be slightly different)
Then add
restart Apache and php in html files will be parsed.
You should leave the page with a .php extension and have Apache handle the file as a normal PHP file. Then use a RewriteRule in your htaccess settings to hide the php file as follows: