Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i want to use wordpress MU with mediawiki on the same domain , but i'm using a kind of mediawiki hosting service called wikifamily.

so i have to different script root :

  1. /var/www/wikifamly for mediawiki
  2. /var/www/blogs for wordpress

I want to use it like this :

  1. or for blog

  2. for mediawiki

I tried to write some think like :

map $http_host $blogid {
    default -999;

server {
    root /var/www/blogs/;
    index index.php;

    location /wiki {

            index index.php index.html index.html;
            root /var/www/wikifamly;
            rewrite ^/?wiki/(.*)$ /index.php?title=$1 last;
            rewrite ^/?wiki/*$ /index.php last;
            rewrite ^/*$ /index.php last;

            location ~* \.php {
                    include fastcgi_params;
                    fastcgi_index index.php;
                    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_sc$

    location / {
            try_files $uri $uri/ /index.php?$args ;

    location ~ \.php$ {
            try_files $uri =404;
            include fastcgi_params;

    #WPMU Files
    location ~ ^/files/(.*)$ {
            try_files /wp-content/blogs.dir/$blogid/$uri /wp-includes/ms-fi$
            access_log off; log_not_found off;      expires max;

    #WPMU x-sendfile to avoid php readfile()
     location ^~ /blogs.dir {
            alias /var/www/blogs/htdocs/wp-content/blogs.dir;
            access_log off; log_not_found off;      expires max;

it's work great with wordpress but no sense with mediawiki

any help please and thanks in advance .

share|improve this question
What subdomain will you use for the wiki? You did not say. – Michael Hampton Feb 23 '13 at 18:49
there is no subdomains as i say for the mediawiki – eyadof Feb 23 '13 at 19:08
You can't do that if you're going to do a wiki family. – Michael Hampton Feb 23 '13 at 19:09
i have multi domain i can't use subdomain for each wiki – eyadof Feb 23 '13 at 19:14
Then you aren't making a wiki family. – Michael Hampton Feb 23 '13 at 19:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.