Topic on Project:Support desk

CSS won't load: mime/type is text/html ?

4
Plindenbaum (talkcontribs)

I've installed MW 1.22.0 in my public_html using a sqlite3 engine

php maintenance/install.php  --dbtype sqlite ...

.

I can see the Main_Page but the CSS won't load (I tried to reload the firefox cache using shift+reload)

The error in firefox is:

[12:26:27.138] The stylesheet http://localhost/~lindenb/mediawiki-1.22.0/wiki/load.php?debug=false&lang=en&modules=mediawiki.legacy.commonPrint%2Cshared%7Cskins.vector&only=styles&skin=vector&* was not loaded because its MIME type, "text/html", is not "text/css". @ http://localhost/~lindenb/mediawiki-1.22.0/wiki/index.php/Main_Page

The HTML source of the main page contains

(...)
<link rel="stylesheet" href="http://localhost/~lindenb/mediawiki-1.22.0/wiki/load.php?debug=false&lang=en&modules=mediawiki.legacy.commonPrint%2Cshared%7Cskins.vector&only=styles&skin=vector&*" />
(...)

A curl with this address returns a text/html page:

$ curl -D - 'http://localhost/~lindenb/mediawiki-1.22.0/wiki/load.php?debug=false&lang=en&modules=mediawiki.legacy.commonPrint%2Cshared%7Cskins.vector&only=styles&skin=vector&*' | more

Date: Tue, 17 Dec 2013 11:28:29 GMT
Server: Apache/2.2.22 (Ubuntu)
X-Powered-By: PHP/5.3.10-1ubuntu3.9
X-Content-Type-Options: nosniff
Content-language: en
Vary: Accept-Encoding,Cookie
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: private, must-revalidate, max-age=0
Last-Modified: Tue, 17 Dec 2013 11:18:33 GMT
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8

<!DOCTYPE html>
<html lang="en" dir="ltr" class="client-nojs">
<head>
<meta charset="UTF-8" /><title>lindenb</title>
<meta name="generator" content="MediaWiki 1.22.0" />
<link rel="alternate" type="application/x-wiki" title="Edit" href="/~lindenb/mediawiki-1.22.0/wiki/index.php?title=Main_Page&action=edit" 
/>
<link rel="edit" title="Edit" href="/~lindenb/mediawiki-1.22.0/wiki/index.php?title=Main_Page&action=edit" />
<link rel="shortcut icon" href="/favicon.ico" />
(...)

Using http://localhost/~lindenb/mediawiki-1.22.0/skins/modern/main.css returns a text/css page

How can I fix this ?

88.130.85.45 (talkcontribs)
Plindenbaum (talkcontribs)

Sorry I'm not a skilled sysadmin,

I put a .htaccess in the MW directory

~/public_html/mediawiki-1.22.0$ cat .htaccess 
RewriteEngine On
RewriteRule ^(api|load)\.php - [L]

I also set

AllowOverride All

in /etc/apache2/mods-enabled/userdir.conf and in /etc/apache2/sites-available/default

and restarted apache:

$ sudo /etc/init.d/apache2 restart

After reload the page(with shift to clear the cache), I still get the error

"[17:11:13.756] The stylesheet http://localhost/~lindenb/mediawiki-1.22.0/wiki/load.php?debug=false&lang=en&modules=mediawiki.legacy.commonPrint%2Cshared%7Cskins.vector&only=styles&skin=vector&* was not loaded because its MIME type, "text/html", is not "text/css". @ http://localhost/~lindenb/mediawiki-1.22.0/wiki/index.php/Azdazd"
Bawolff (talkcontribs)

It looks like that is caused by rewrite rules, try doing the instructions at Manual:Short_URLs instead of whatever you did.

Reply to "CSS won't load: mime/type is text/html ?"