HTML Extension

Started by CokeCan, January 06, 2004, 05:35:32 PM

Previous topic - Next topic

CokeCan

Hi, is there any way to show a php file with a ".html" extension? :-\
Thanks in advanced!

Killer Possum

Wrap the php code in the php tags

Aquilo

add this to .htaccess

AddHandler application/x-httpd-php .html

CokeCan

Thanks for your answers! ;)

Quote from: Aquilo on January 06, 2004, 06:05:11 PM
add this to .htaccess

AddHandler application/x-httpd-php .html
Should I add a .htaccess file just with this line?

Aquilo

shure, if could also tell it what file to use as it's Directory Index
DirectoryIndex index.html
AddHandler application/x-httpd-php .html

but that one line is ok.

CokeCan

Thanks but when I upload that file and I try to get in a page, it doesn't work :'(
Should I add something more there? or add it in a special directory?

Oldiesmann

It's not working for some reason... I've tried a lot and it just gives a 404 error. If I try it with the DirectoryIndex line, it gives us an Internal Server Error message.

Aquilo

sorry about that! I guess you have to put addtype and AddHandler

http://www.xtram.net/html-php/index.html
but this didn't work on my pc so if your host lets you do it then it should work!
off to edit php.ini


DirectoryIndex index.html
AddHandler application/x-httpd-php .html
AddType application/x-httpd-php .html

Aquilo

this overflow thing needs tweaking :(

Oldiesmann

#9
Ok. I'll go fix it for him.

EDIT: Still doesn't work. DirectoryIndex still yields an Internal Server Error and adding that other line doesn't do anything...

Aquilo


CokeCan

Should I upload it in some special way (Binary or ACSII)?

Aquilo

#12
ACSII - if your uploading it in binary then there is your problem, Apache's not going to giggle and say ok your gonna get that internal server error I was talking about in another thread here!


if you have been uploading it in binary delete the old one first or you'll get the same thing - delete then upload in ASCII

Acf

QuoteApache's not going to giggle and say ok your gonna get that internal server error I was talking about in another thread here!

hehe that sounds wicked :P

Giggle you have an internal server error :P
Sigh...

Aquilo

hehe I did forget the comma after ok! :D :D

CokeCan

I don't know why but it keeps not working :'(

Aquilo

sorry man, ask your host if they allow that in your .htaccess files!

CokeCan

I am doing it, thanks for your help! :)

Advertisement: