I've been trying to learn to use htaccess files for apache and everything I find starts out with using it for authentication. The only thing I want to do with the htaccess file is add MIME types so I was wondering what all I actually needed for just that. I know AllowOverride in the httpd.conf file is set to AuthConfig.
Can anyone tell me what all I need to get it to work? Thanks!
htaccess MIME types
Started by jjjaroscak, Nov 01 2010 09:41 AM
12 replies to this topic
#1
Posted 01 November 2010 - 09:41 AM
|
|
|
#2
Posted 01 November 2010 - 10:41 AM
What you had asked is too general to give an answer, what are you wishing to do by adding mime types?
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#3
Posted 01 November 2010 - 11:03 AM
I'm trying to get Microsoft 2007 documents (docx etc) to open correctly in IE
#4
Posted 01 November 2010 - 03:13 PM
I am not sure, but the specs seem to point to this handler:
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#5
Posted 01 November 2010 - 03:35 PM
Yes, I have what all the AddType's are supposed to be, but what I'm not sure about is what else I need in my htaccess file for it to take effect because right now it doesn't seem to be helping anything, so I guess I assume I'm missing something so that the htaccess file isn't actually loading the AddType's
#6
Posted 01 November 2010 - 08:20 PM
What exactly happens to you IE browser when you browse the file? It can be numerous reasons, not just that single MIME.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#7
Posted 02 November 2010 - 06:41 AM
It tries to open them as zips since it doesn't know what the externsion means. So therefore I need the mime types. What all do I need in my htaccess file to get the mime types to load?
#8
Posted 02 November 2010 - 09:01 AM
Maybe try adding this to /etc/mime.types file (or wherever your Apache config may be)
I had looked extensively at the web and those two solutions are all I can find.
application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
I had looked extensively at the web and those two solutions are all I can find.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#9
Posted 02 November 2010 - 01:34 PM
Yeah, I know this is supposed to be the solution, and I'm currently limited to only being able to edit my htaccess file. The file was completely blank, then I added the AddTypes, but it didn't do anything. My guess is I'm not doing something right, so Apache is just ignoring my htaccess file because I haven't added something that it needs.
#10
Posted 02 November 2010 - 03:17 PM
Where are you adding the .htaccess file? You can try to put gibberish into the file and your server will spit out an HTTP 500 error to verify it is actually reading i t.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#11
Posted 03 November 2010 - 08:44 AM
Okay, I did have the .htaccess file someplace that apparently doesn't work. Putting it into /var/www/html does.
having an htaccess with the following gives me the error "order not allowed here"
Having just the AddType I get the error "AddType not allowed here"
So I am guessing I'm missing something
having an htaccess with the following gives me the error "order not allowed here"
order deny,allow <Files .htaccess> order allow,deny deny from all </Files> AddType application/vnd.openxmlformats-officedocument.wordprocessingml.document .docx
Having just the AddType I get the error "AddType not allowed here"
So I am guessing I'm missing something
#12
Posted 03 November 2010 - 10:40 AM
Try adding AllowOverride FileInfo before the AddType entry, if this is not allowed then you are disallowed to do anything with your htaccess files until you change the appropriate AllowOverride option in httpd.conf for your Apache server.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.


Sign In
Create Account

Back to top









