A place where the Joyent community can gather, help each other out, and stay informed.
You are not logged in.
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
You'll need to use forcetype. Try putting this in an .htaccess file:
<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.
Offline
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
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
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.
Offline
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