[forum] intermittent sylesheet MIME type issue

Website issues & feedback. Constructive criticism is welcome.
(Guest posting is allowed under certain circumstances)
If you have a problem with certain individuals, then PM the Staff account.
User avatar
skellr
Trained
Trained
Posts: 72
Joined: 17 Aug 2007, 15:58

[forum] intermittent sylesheet MIME type issue

Post by skellr »

Usualy the first time a page is loaded in a session there is no page style.

Code: Select all

Error: The stylesheet http://forums.wz2100.net/?PHPSESSID=67d083e2e82261bb53bcf774730e0ca6&Themes/wz2100dev/style.css?rc3 was not loaded because its MIME type, "text/html", is not "text/css".
Source File: http://forums.wz2100.net/?action=recent
Line: 0
Error: The stylesheet http://forums.wz2100.net/?PHPSESSID=67d083e2e82261bb53bcf774730e0ca6&Themes/default/print.css?rc3 was not loaded because its MIME type, "text/html", is not "text/css".
Source File: http://forums.wz2100.net/?action=recent
Line: 0
Firefox and Opera are a bit stubborn in "strict mode".
Kamaze
Regular
Regular
Posts: 1017
Joined: 30 Jul 2006, 15:23

Re: [forum] intermittent sylesheet MIME type issue

Post by Kamaze »

This happens if you don't accept or block cookies.
I just made the css-link's static, but it seems that the SMF rewrites the URL...

I'll see if i can find an solution.
Last edited by Kamaze on 10 Feb 2008, 13:47, edited 1 time in total.
We all have the same heaven, but not the same horizon.
User avatar
skellr
Trained
Trained
Posts: 72
Joined: 17 Aug 2007, 15:58

Re: [forum] intermittent sylesheet MIME type issue

Post by skellr »

Thanks Kamaze,
I do accept cookies if that helps... or not.  :)
Kamaze
Regular
Regular
Posts: 1017
Joined: 30 Jul 2006, 15:23

Re: [forum] intermittent sylesheet MIME type issue

Post by Kamaze »

The bad guy seems to be PHP's autosession function, which 'rewrites' url's it shouldn't rewrite. (For example, the css paths)
I'll see if i can fix it this weekend.
We all have the same heaven, but not the same horizon.
User avatar
kage
Regular
Regular
Posts: 751
Joined: 05 Dec 2006, 21:45

Re: [forum] intermittent sylesheet MIME type issue

Post by kage »

you can do that with

ini_set('session.use_only_cookies', 1);

--- OR ---

ini_set('session.use_trans_sid', 0);

you can probably also mess with the 'url_rewriter.tags' config option, but it shouldn't be rewriting tags unless you explicitly tell them to.

the session reference is at http://www.php.net/manual/en/ref.session.php
Kamaze
Regular
Regular
Posts: 1017
Joined: 30 Jul 2006, 15:23

Re: [forum] intermittent sylesheet MIME type issue

Post by Kamaze »

I know, but it doesn't make much sense, since the server will get a re-setup this weekend :)
Lets see then...
We all have the same heaven, but not the same horizon.
User avatar
kage
Regular
Regular
Posts: 751
Joined: 05 Dec 2006, 21:45

Re: [forum] intermittent sylesheet MIME type issue

Post by kage »

tis a good point
User avatar
skellr
Trained
Trained
Posts: 72
Joined: 17 Aug 2007, 15:58

Re: [forum] intermittent sylesheet MIME type issue

Post by skellr »

Ok then. Sounds like fun.
Kamaze
Regular
Regular
Posts: 1017
Joined: 30 Jul 2006, 15:23

Re: [forum] intermittent sylesheet MIME type issue

Post by Kamaze »

The problem with the first visit should be fixed now.
Seems to be a bit retarded, PHP should only rewrite href-values in a tag. But it still rewrites everything which looks like an URL tag.

I solved the CSS issue by using relative paths, which works fine, but Images are brocken when blocking cookies, because PHP adds the SID there as well...
We all have the same heaven, but not the same horizon.
User avatar
skellr
Trained
Trained
Posts: 72
Joined: 17 Aug 2007, 15:58

Re: [forum] intermittent sylesheet MIME type issue

Post by skellr »

Thanks :D