View Full Version : MIME types configuring files
fileserverdirect
11-15-2007, 12:25 AM
Hello!
(Mod's please move this thread if it's not in the right place)
After a recent topic on the forums, "JS file reading its own querys" I learned alot of what a MIME type can do (i.e. turn a php file into a JS file, with php synatx). Now my question is that can I make up a file extension ( lets say .login) and with a mime type, I turn it into a php document, still with the extension .login and with php sytax? If you need any clarification on what I am trying to do, please post :)
Thanks,
thetestingsite
11-15-2007, 12:47 AM
you can add this to either your httpd.conf file or any htaccess file i believe (for apache that is):
AddType application/x-httpd-php .ext .goes .here
Hope this helps.
fileserverdirect
11-15-2007, 01:26 AM
Thanks,
I do not normally write htaccess files, I just pasted in to a new file called (htaccess.htaccess) in the folder where the file is ( Im am using .it) I does not phrase it. Please, I am new to this, Please give detailed information on how to do this, Thanks,
It should be called .htaccess, not htaccess.htaccess. The dot is a UNIX convention for hidden files.
fileserverdirect
11-15-2007, 08:52 PM
HELP!
After I renamed it, it disappeared, and when I went to my main page, a 500 Internal Error came up. Nothing works in that folder, my entire site does not work. But everything not it the folder still works. How can I properly add the .htaccess, and delete the one I cannot see!
What are you using to upload the file? If you're in SSH or something, use ls -a to show hidden files too. If you're using a graphical client, there's probably an option to show hidden files.
The 500 error means that there's something wrong with your .htaccess and Apache can't understand it.
fileserverdirect
11-15-2007, 09:18 PM
O.K. I am clam now, I got rid of the file, But where can I put the file so that it will work. Maybe I just wrote the file wrong. cna You please show me what to upload and where to do it. Thanks,
Yes, your file is probably wrong. Post it here?
fileserverdirect
11-17-2007, 01:40 AM
Sorry for the late post (I've been sick for 2 days).
----
Like I said before, this is the first time I have ever messed around with this stuff. My file (.htaccess) looks exactly as thetestingsite's just with my file extension:
AddType application/x-httpd-php .it
Is there some syntax I am missing? Im I puting the file in the wrong folder?
Thanks,
BLiZZaRD
11-17-2007, 05:39 PM
make file in notepad, notepad++ or other PLAIN TEXT Editor. Do NOT use WORDpad, Word, etc.
put this in it:
AddType application/x-httpd-php .html .htm .it
AddHandler application/x-httpd-php .html .php .htm .it
no extra spaces, each on it's own line. Save it to your desktop, name it "file.txt"
upload it to your server in the HIGHEST point possible (usually / - root) if you have a public_html or root folder it need to go outside that.
once uploaded rename to ".htaccess" Doing this will make sure it is uploaded in the right context (Binary vs. ASCII).
Make sure its CHMOD is 644, nothing else.
it should now work. If not, then ask your server host if .htaccess is supported on the server.
upload it to your server in the HIGHEST point possible (usually / - root) if you have a public_html or root folder it need to go outside that.Inside. It needs to be within the web root or Apache won't find it.
BLiZZaRD
11-17-2007, 05:46 PM
Only on dedicated servers. shared servers have / or root but it is a false root, You CAN put it inside public_html or root folders, but then it will only do the files inside there, subdomains that go inside the public_html folder etc won't be affected by it, and you will have to create another. Place it outside public_html and it effects ALL.
(only reason I know is I fought with it for 2 months on my previous host :p )
fileserverdirect
11-19-2007, 07:03 PM
Sorry for the late post again (This stomach virus is the worst, The only reason I made it to the computer is because of Advil:))
I tryed it, Inside and out of the root folder.
500 Internal Error
The error was also not a custimized one. A line of text at the bottom of the error generated by the server:
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
Why doesn't it work?
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.