Skip to main content

Can I set a default MIME type

Comments

4 comments

  • rpvw
    Why don't you just add acceptable (and relevant) extensions to the files ? I think you are making things overly difficult for yourself ! OR You could try adding a DefaultType in your .htaccess if your server is running below Apache 2.4, otherwise you would probably have to use ForceType wrapped in a FilesMatch OR You could try to use a rewrite rule in your .htaccess to add the .html extension to any file that doesn't have one.
    0
  • icaravans
    Why don't you just add acceptable (and relevant) extensions to the files ? I think you are making things overly difficult for yourself ! OR You could try adding a DefaultType in your .htaccess if your server is running below Apache 2.4, otherwise you would probably have to use ForceType wrapped in a FilesMatch OR You could try to use a rewrite rule in your .htaccess to add the .html extension to any file that doesn't have one.

    Thanks for the input. The issue is with dealing with multiple sites with large amounts of pages without extension that have been working fine on other hosting and are already indexed so changing extension now would be time consuming and could have a negative impact on SEO. I have tried the ForceType option and it seems to be working good now. Thanks a lot for the suggestion, ForceType was many hours quicker than changing file types and the linking structure across some large sites. Out of interest do you know why the default MIME type is plain text when the huge majority of web servers will be serving up html and not plain text?
    0
  • 24x7server
    Out of interest do you know why the default MIME type is plain text when the huge majority of web servers will be serving up html and not plain text?

    A file is downloaded or it displays codes directly only when the required module is defined wrong in the server configuration or rather a handler issue. Check the apache error logs and paste it here, so everyone here can take a look and advise accordingly..
    0
  • cPanelMichael
    I have tried the ForceType option and it seems to be working good now. Thanks a lot for the suggestion, ForceType was many hours quicker than changing file types and the linking structure across some large sites.

    Hello, I'm glad to see this helped. I've marked this thread as solved.
    0

Please sign in to leave a comment.