The Joyent Community

A place where the Joyent community can gather, help each other out, and stay informed.

You are not logged in.

#1 2004-06-09 03:04:32

mikeyc
New member
Registered: 2004-06-09
Posts: 19
Website  Expertise

file extensions

I've created an .htaccess file and uploaded it into public_html folder containing:

AddType application/x-httpd-php .html

Doesn't work.

Basically, I want files with a .html extension to be treated as PHP. I've also played around with webmin with no luck.

Can someone walk me through this?

Thanks in advance.

--
MikeyC

Offline

 

#2 2004-06-09 03:46:12

Jez Nixon
Member
From: United Kingdom
Registered: 2004-06-01
Posts: 202
Website  Expertise

Re: file extensions

You'll need to use forcetype. Try putting this in an .htaccess file:

Code:


<FilesMatch "\.htm">
ForceType application/x-httpd-php
</FilesMatch>

All .htm and .html files will now pass through php. On a side note, use it sparingly- it's really wasteful to pass non-php files through the php parser.


And I thank you for the items that you sent me: the monkey and the plywood violin

Offline

 

#3 2004-06-09 04:00:33

mikeyc
New member
Registered: 2004-06-09
Posts: 19
Website  Expertise

Re: file extensions

nixon wrote:

You'll need to use forcetype. Try putting this in an .htaccess file:

Code:


<FilesMatch "\.htm">
ForceType application/x-httpd-php
</FilesMatch>

All .htm and .html files will now pass through php. On a side note, use it sparingly- it's really wasteful to pass non-php files through the php parser.

It still doesn't work. Where exactly should the .htaccess file sit? I have it in public_html and have scattered it around other subfolders to test. Isn't there a way to do this through webmin? Under Apache server, there appears to be a MIME type options, but they don't seem to have any effect for me.

Offline

 

#4 2004-06-09 04:01:01

Damelon
Member
From: Lyon, France
Registered: 2004-06-01
Posts: 880
Website  Expertise

Re: file extensions

I think the cleanest way to do this is to have Jason add it to the default instructions for your account. I believe he has even expressed that is what he would prefer.

Offline

 

#5 2004-06-09 04:15:54

mikeyc
New member
Registered: 2004-06-09
Posts: 19
Website  Expertise

Re: file extensions

Damelon wrote:

I think the cleanest way to do this is to have Jason add it to the default instructions for your account. I believe he has even expressed that is what he would prefer.

That sounds good. Jason, could you add it to the default instructions for my account and let me know.

Thanks.

Offline

 

#6 2004-06-09 04:17:53

Jez Nixon
Member
From: United Kingdom
Registered: 2004-06-01
Posts: 202
Website  Expertise

Re: file extensions

Yes, letting Jason do it is probably the best idea. It might be an idea to email him Mickey, as opposed to just leaving a request in the forum.


And I thank you for the items that you sent me: the monkey and the plywood violin

Offline

 

#7 2004-06-09 06:25:33

jason
a chief (i started this place)
From: San Francisco
Registered: 2004-06-01
Posts: 8821
Website  Expertise

Re: file extensions

Just let me add it. I do html as php but couldn't impose that upon everyone.

Offline

 

#8 2005-09-11 04:11:09

borisu
New member
Registered: 2005-09-08
Posts: 4
Expertise

Re: file extensions

I'm gonna take this one step further... :D

I have this working on another server, and I also know it doesn't work on all, but no idea why. It doesn't seem to work here. So here goes:

in .htaccess:
<code>
DefaultType application/x-httpd-php
DirectoryIndex home
</code>

Now on some servers this actually works. A file simply named "home" not only gets served as the "index" (this is not the issue), AND it, and all extensionless files, get parsed by PHP.

Not so here. Further, using "ForceType application/x-httpd-php" causes css and js files to be misinterpeted by good webbrowsers (or not sent .. not sure what's going on with that really), even if I add AddTypes for both.

This is more of a general mystery to me than a TxD specific "problem". An identical .htaccess on two different servers acts totally differently...

Any ideas? :)

Offline

 

#9 2005-10-26 23:28:22

julik
Member
From: Utrecht, Netherlands
Registered: 2005-03-12
Posts: 224
Website  Expertise

Re: file extensions

I have a problem with that as well. DefaultType has effect for the files I upload via SFTP, but no effect for the files MT generates. Moreover, all of my error logs are empty.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson