Apache_1_3_12
11-26-2000, 02:27 PM
I would like instructions on setting up .html to be parsed as .php
Mostly so a customer doesn't keep asking "why is my main page index.php instead of index.html" I figure for PURE html I would use .htm and for PHP I could use .html.
Félix C.Courtemanche
11-26-2000, 02:44 PM
Even though that will not help the speed of your server...
simply change this in your srm.conf or httpd.conf file:
You should have something similar to this:
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php-source .phps
Modify it to something like:
AddType application/x-httpd-php .html
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php-source .phps
That way your .html files will be parsed before being displayed. You might have to remove the entry concerning .html in your mime.type file, I am not sure.
i am a
11-26-2000, 05:03 PM
yes, i agree with felix about the slightly longer load time... each .html page will have to be parsed now, which will not be as fun for everyone else on your server...
i say just have a very easy to see notice that php files must have the phtml, php, php3 extension... might as well teach people how to do things the right way... no?
riffola
11-26-2000, 05:23 PM
This way only the .html files in your directories are parsed as PHP files.
AddType application/x-httpd-php .html
Put that in your .htaccess and hopefully it'll work.
Félix C.Courtemanche
11-26-2000, 07:30 PM
the .htaccess method will work, but it will be even slower because have to parse the .htaccess, then parse the .html.
The best solution is to use the right extensions.
The so-so solution is what I said
and the slowest solution is the .htaccess, but also the easiest.
elsmore1
11-29-2000, 12:06 AM
but- the .htaccess method can be used to surgically insert the extra parsing on only certain files and not change the default configuration of the entire webserver. kind of like a "p**** all .html files *in this directory* as php files"
instead of parsing all .html files the server has access to.
May not apply or make a difference in this situation, but is something to consider.
Félix C.Courtemanche
11-29-2000, 02:56 AM
You are right, but for the faster process, you could also write that in your httpd.conf file:
<Directory /pat/to/web/dir/sub>
AddType application/x-httpd-php .html
</Directory>