Reputation: 7148
I recently installed MediaWiki version 1.19 on a Debian server running Apache. I am able to access pages successfully. However, the pages come up unstyled. I cannot load the stylesheet in my browser.
Using Firebug, I've compared the response headers for my site to those for a Wikipedia page. The relevant difference appear to be that my site serves up the stylesheet url (load.php?debug=true&lang=en&modules=mediawiki.legacy.commonPrint%2Cshared|skins.vector&only=styles&skin=vector&*
) as text/html
content-type and Wikipedia serves it up text/css
.
I suspect that it has something to do with the Apache rewrite module settings. I found this page discussing the issue and offering various suggestions for the rewrite rules. I've tried them all without any success.
One additional detail that may be relevant: I'm running the MediaWiki code out of the /var/www/wiki
directory on my Debian server. I've updated the appropriate MediaWiki config settings and added these lines to the .htaccess
file in /var/www
:
RewriteEngine On
RewriteRule ^/$ /wiki/index.php?title=Main_Page [L,QSA]
RewriteRule ^/wiki/*$ /wiki/index.php?title=Main_Page [L,QSA]
RewriteRule ^/wiki/(.+)$ /wiki/index.php?title=$1 [L,QSA]
What can I do to get Apache to serve up this load.php?debug=true&lang=en&modules=mediawiki...
link as text/css
content?
Upvotes: 2
Views: 2692
Reputation: 7148
The issue turned out to be a basic configuration problem. I had the DocumentRoot
in my Apache configuration set to /var/www/wiki
. I had the wgScriptPath
in LocalSettings.php
set to /wiki
.
Changing wgScriptPath
path to ""
and getting rid of the .htaccess rules solved the problem.
Upvotes: 7