Forum Moderators: coopster

Message Too Old, No Replies

.PHP v. .HTML

How to best accomplish it

         

mquarles

11:00 pm on Apr 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have been told that there is a way to tell Apache to treat your .html files like .php files, so that you can use .html extensions when running PHP.

Can anyone help me out with how to do it?

Is there a better way to accomplish this objective?

MQ

jatar_k

11:09 pm on Apr 7, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



try this

Parsing PHP with HTML file extension [webmasterworld.com]

mquarles

11:36 pm on Apr 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I actually don't need to parse anything, just want my pages to have the .html extension.

I added a Mime Type
application/x-httpd-php .html

And it seems to work. Is that going to screw anything else up?

MQ

jatar_k

11:38 pm on Apr 7, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



is there any php in the html files?

If not you don't need to do anything, if there is you just do the AddType lines in that thread.

mquarles

11:46 pm on Apr 7, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, there is PHP in the file. I found the htaccess method a little more difficult to understand in my non-techie brain, and best I can tell the mime type does the same thing. Just wanted to be sure I didn't do anything that would have unintended consequences.

I think it does the same thing, but I am not 100% sure. The mime-type I can do through cpanel without worrying about htaccess.

MQ

P.S. Thanks for the help, and for your tolerance of a question that has obviously been asked before!

jatar_k

2:10 am on Apr 8, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



>>your tolerance of a question that has obviously been asked before

lol, no worries, that is what this is all about anyway.

>>The mime-type I can do through cpanel

I would imagine it is the exact same thing as the htaccess method.