Web Hosting Talk







View Full Version : Forcing Apache to parse *.HTML as PHP w/ .htaccess


SepsisNet
04-30-2001, 12:51 AM
Does anyone know the correct format on how to do this with .htaccess?

Should be something like this:

AddHandler server-parsed .html
AddType text/html .html

cimshimy
04-30-2001, 01:26 AM
AddType application/x-httpd-php .html

SepsisNet
04-30-2001, 01:46 AM
Originally posted by cimshimy
AddType application/x-httpd-php .html

AddHandler server-parsed .html
AddType application/x-httpd-php .html

Doesn't work :(

Dim8
04-30-2001, 06:09 AM
AddType application/x-httpd-php htm
AddType application/x-httpd-php html

Notice there isn't a period before htm and html. Now it should work. :)

SI-Chris
04-30-2001, 06:18 AM
This one works for me (even with the period :) )
AddType application/x-httpd-php .php .htm

cperciva
04-30-2001, 06:33 AM
Originally posted by SepsisNet


AddHandler server-parsed .html
AddType application/x-httpd-php .html

Doesn't work :(

That's because you're being inconsistant. The first line tells Apache to handle .html files with its SSI engine, while the second line tells it to handle them as PHP files.

Decide which you want, and take out the line you don't want.

(SH)Saeed
04-30-2001, 07:55 AM
So he can't have both? :D :D

We should add CGI to it as well, that would make things a lot easier ;) We can let the server decide which one it is.

cimshimy
04-30-2001, 04:09 PM
You can't have both.. if you want CGI and SSI in the same thing, I think theres a module for that. mod_supercgi? Something like that...


Andrew

jtan15
05-02-2001, 08:56 PM
The problem might be that your httpd.conf file is not giving you access to use the htaccess files.

<Directory /path/to/dir)
Options All
<Directory)

Replace the )'s with >'s.