Phil_Ko
08-26-2002, 12:53 AM
Hello,
This is more of an Apache question but, how can I rename my PHP files to HTML and still have them work like PHP?
I'd like all the files that the visitors see to end with .HTML and still keep the .php for the scripts I need to work with.
Thanks
The Prohacker
08-26-2002, 01:02 AM
In an .htaccess for that dir put:
AddType application/x-httpd-php .html
Samuel
08-26-2002, 01:19 AM
hahah prohacker, just noticed your sig, good show!
iamdave
08-26-2002, 02:51 AM
Originally posted by Samuel
hahah prohacker, just noticed your sig, good show! Yup, me too, let's see if Tim will get that taken off too...
pgrote
08-26-2002, 02:37 PM
When you make that change you cannot combine it with other ADDTYPEs, right? For instance SHTML.
combs
08-27-2002, 01:40 PM
I don't think this can be done. You will have to name them .php to work on the server side.
I think it might work, but I really wouldn't advise it, especially if you have "real" .html files. PHP would have to parse every HTML page, even if it didn't contain any actual PHP. In some rough tests I did, I got about 40K hits over a 30 second period when they were .html files, but under 1000 in 30 seconds as .php files. (These are off the top of my head; they might be way off.) Some tuning could probably help things a lot, but it does illustrate why you really dont' want to unneccesarily parse .html files with PHP.
Is there a need for doing this, or is it just a preference?
Phil_Ko
08-28-2002, 12:45 PM
Hello,
No real need other than the fact that the existing files are all named .html and are setup to use ssi to include output from scripts.
If I got 40K hits in 30 seconds I'd be a happy camper, as it is I'm just a Jolly Rancher.
Thanks