ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

MIME type problem

January 08, 2008 8:12am

Subscribe [1]
  • #1 / Jan 08, 2008 8:12am

    matt960

    16 posts

    hi all,

    i’m having an odd issue with pages not displaying styles and images and not parsing javascript files.

    strangely, my site index page displays absolutely error free, then, when i click on any link from the index page to another, the linked page displays without images and styles applied. when i look at the console error log it reads various errors relating to MIME types:

    “Resource interpreted as image but transferred with MIME type text/html. “
    “Resource interpreted as script but transferred with MIME type text/html. “
    “Resource interpreted as stylesheet but transferred with MIME type text/html. “

    my understanding of MIME types is limited, and i can’t understand why the index.php page displays fine then every subsequent page displays with incorrect MIME types.

    as i missing a preference in the control panel somewhere, or is the server configured incorrectly?

    i am using default MAMP (apache/MYSQL) installation with expression engine 1.6.1.
    also maybe worthy of note is that i have transfered the expression engine site and database from my work computer (also running MAMP) to my home computer that not displaying correctly.

    thanks in advance for any you can help

  • #2 / Jan 08, 2008 10:14am

    Robin Sowell

    13255 posts

    Sounds weird to me.  If you look on the working main page, find the link to a working image.  Jot it down- then go to an internal page- is the image link identical- and is it a full url or relative?  (If this doesn’t clear things up, is it possible to link to it in action?  Or is it working on the work computer- but the home copy is failing?)

  • #3 / Jan 08, 2008 12:42pm

    matt960

    16 posts

    thanks for the reply,

    the source for the main working page “http://localhost:8888/millennium/index.php” shows the main logo image link as:

    images/millennium_logo.gif

    and the source for a page that links from the main page “http://localhost:8888/millennium/index.php/about_us/whos_who” shows the main logo image link as:

    images/millennium_logo.gif

    identical! yet the internal page doesn’t display the image or execute any css or javascript.

    Weird indeed.

    i’m not too sure what you mean by ‘link to it in action’ but i wont have access to the work machine for at least 2 weeks to do any tests there, i’m stuck with the testing environment i have at home for now.

    for what its worth, i’ve tried another testing server instead of MAMP, which used different versions of php/mysql etc but had the same results, which tends to make me think the problem is with my expression engine install? though to be honest i’m running out of theories or things to try apart from a fresh start.

    i was hoping it was a checkbox i forgot to tick, or a path field i forgot to change.
    wishful thinking no doubt!

  • #4 / Jan 08, 2008 12:44pm

    Robin Sowell

    13255 posts

    Hm- try it with a full url rather than a relative one.  I generally create a global {image_path} that’s the path to my main image folder for just such a scenario.  But anyway- for testing?  Just put in the full url, see if it makes a difference.

  • #5 / Jan 08, 2008 1:01pm

    matt960

    16 posts

    it works with a full URL!  - what does this mean! - the relative link is mis-directed?


    with regards your global image path tip, do you create the global image path as an absolute link in the template global variables eg.

    variable name: {image_path}
    content: http://localhost:8888/millennium/images/

    then call it as any other global variable eg.

    {image_path}millennium_logo.gif
  • #6 / Jan 08, 2008 1:10pm

    Robin Sowell

    13255 posts

    Well- I was thinking with the relative url?  The link is just wrong- which doesn’t explain why you get the mime type message- hence I’m a bit confused.  But it does make sense a relative link would differ if you’re looking at it from url mysite.com/index vs mysite.com/index/something/else- because it will be looking in different folders based on that url.

    I always go with the global and use full urls so I don’t have to think about it.  And yep- that’s exactly how I do the global- I use a user defined global, but there are other options.  Just makes it fast and easy if I move the site/change urls/whatever.

    Make sense?

  • #7 / Jan 08, 2008 1:39pm

    matt960

    16 posts

    this is the first time i’ve had to move an installation from one place to another so your help with the global variables is welcome advice - i’ll attempt to use this method from now on. i’m guessing that when i move the site from one place to another i would only have to change the global links to the css, javascript and images? handy tip.

    what you say about the relative link being plain old wrong makes perfect sense - i wish i could get at my work install to see if i have i somehow altered the link structure somewhere down the line, though it seems unlikely simply due to the amount of code changing i would have had to do - i hope i would have remembered!

    the MIME type thing is a still little beyond me i’m afraid - i’ve no idea why i get no MIME errors on index page, yet they appear on all linked pages -my knowledge of MIMEs limits my problem solving/eliminating potential.
    do you think is reasonable to assume it is installation/testing environment setup problem as opposed to an internal expression engine setup/control panel related issue? i could try setting up the lot on another machine i have here to eliminate the chance it could my testing environment configuration.

    thanks again.

  • #8 / Jan 08, 2008 1:44pm

    Lisa Wess

    20502 posts

    Resource interpreted as image but transferred with MIME type text/html. “ 
    “Resource interpreted as script but transferred with MIME type text/html. “ 
    “Resource interpreted as stylesheet but transferred with MIME type text/html. “

    For the images, how are you transferring them to your server?  By FTP? You need to make sure you have them being sent as binary.

    For the script and stylesheets - are these EE templates are separate files you’re uploading?  If the latter, then I suspect it’s a file transfer issue again, though it could be a hosting environment. That is a server error though, so outside of ExpressionEngine - and you’d get it if you visted those files directly, as well.  You can double check that to make sure, of course. =)

  • #9 / Jan 08, 2008 2:19pm

    matt960

    16 posts

    thanks for the reply lisa,

    at the moment, i’m working locally - my mac is my testing server, so i am just copying/saving files into the testing environment’s ‘htdocs’ folder - no FTP going on?

    the scripts and css are currently separate files, outside of expression engine.  - the wierd part is how i get no errors at all when loading the index.php page but every page linked from the index page creates the MIME error.

    i’m in the process of using a global variable to use absolute links to the css/javascript/images etc. instead of the questionable relative links i was using before (as recommended by robin)- i’ll see if it helps any, though it seems like good general practice anyway.

    if visit an image directly as you suggest eg. ‘http://localhost:8888/millennium/images/logo.gif’ the image displays in the browser yet safari’s web inspector console gives a MIME warning: Resource interpreted as document but transferred with MIME type text/gif.  - the console in firebug in firefox gives no such error!
    beginning to think the console could be misleading me! though this still does not explain why the index page diplays without error!

    odd.

  • #10 / Jan 08, 2008 2:31pm

    Lisa Wess

    20502 posts

    voodoo6; since visiting it directly causes the error, this is definitely server or file related, not EE related.  That said; I have no idea why that would be happening just copying files over.  It could just be the local development environment, but you might want to post this on some forums specific to such endeavors where you’ll get more focused help for troubleshooting the environment.

  • #11 / Jan 08, 2008 2:37pm

    matt960

    16 posts

    i appreciate the help lisa,
    i think i’ll set up a ‘fresh’ testing environment tomorrow and see if i get the same problems and hopefully narrow the issue down a little.

    thanks again.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases