Hello everyone,

I have troubles running several wikis on a same installation.
In fact I cannot use neither symlinks nor subdomain redirections to do it. So I 
have tried a hand-mde solution with a copy of index.php.
i.e. : I want to run 4 wikis, that I have called :
- andra
- anthony
- nita
- crep

To go to andra for example I type the address :
pascal.lautre.net/w/andra.php

and I have created a LocalSettings-$wikiname.php for each of the 4 wikis, 
setting a switch in the main LocalSettings.php to include the appropriate one.
But I've got all my vairables and paths erased when the wiki redirects, it 
calls index.php/Accueil for example and I have no way to know what was the 
original call.
I have even tried to use a hook, the BeforePageRedirect hook, but it worked 
only for loading the Accueil page (I guess it would be called HOme in english, 
or Welcome), after, I have the problem again when I try to connect, the link 
points to index.php instead of andra.php.

Here is the code of my LocalSettings.php:

<?php

$ppw = "/w";
if (! isset($pascal_request_uri)) {
  $pascal_request_uri = split("/", $_SERVER['REQUEST_URI'])[2];
}

$wgHooks['BeforePageRedirect'][] = function ($out, &$redirect, &$code) {
  GLOBAL $pascal_request_uri;
  GLOBAL $ppw;

  $redirect = ereg_replace("/index.php", "/$pascal_request_uri", $redirect);
  return true;
};

switch ($pascal_request_uri) {
  case "andra.php":
  case "anthony.php":
  case "nita.php":
  case "crep.php":
    require_once("LocalSettings-$pascal_request_uri");
    break;
  default:
    echo "<p>NO wiki specified. please choose a wiki, ex: <br>\n";
    echo $_SERVER['SERVER_NAME'] . "$ppw/idees.php<br>\n";
    exit(1);
}

Thank you for any help!

Pascal

_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Reply via email to