Serving mediawiki from a subdomain

I just managed to get MediaWiki working from a subdomain, rather than from /wiki. There are two changes that you need to make to localsettings.php when trying to serve MediaWiki from a subdomain. The first is to change

$wgScriptPath = "" ;

from whatever the path was, and the second is to insert:

$wgServer = "http://subdomain.yourdomain.tld";

The first setting stops the scripts from being called from the wiki subdirectory (which is now your subdomain) and the second tells bits of MediaWiki where to find things like the skins and images. That's the best explanation I can come up with right now!

Reference Installing MediaWiki on a subdomain? and Serving MediaWiki from a Subdomain

This entry was posted in HandyHints. Bookmark the permalink.

10 Responses to Serving mediawiki from a subdomain

  1. John B. Cole says:

    This worked like a charm for me with MediaWiki 1.6.8. Thanks for the help!

  2. Cam says:

    Thank John – glad to be of help!

  3. mike says:

    Thanks also, that saved me a bit of trouble. I was moving several websites to subdomains and my original wiki install became inaccessable. This fix allowed me to make the switch to subdomain with ease. Thanks again.

  4. Cam says:

    Cool Mike! Thanks for the comment. It’s funny that I wrote this so long ago when I was setting up a genealogy website from my family, and quite soon after working this out I shut down my mediawiki installation and moved to dedicated genealogy software from TNG

  5. PeteM says:

    Worked for me (and saved me hours) with Wiki 1.4.7!

    Pete

  6. Sebatian says:

    Thanks for that clue! This was that I searched for!

  7. Rob says:

    Excellent. Thank you.

  8. Many Tanks by me too!

  9. John says:

    thanx metoo
    now I would like to rewrite categories to subdomains

  10. Cam says:

    hmm.. can’t help you there John, never attempted that. But a quick search has turned up the following:

    http://www.organicseo.org/URL_Rewriting.html#Rewriting_Subdomains

    which seems like something along the lines of rewriting categories to subdomains. I haven’t tested it – I no longer have my MediaWiki installation…

    Cam.