Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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'm using CentOS 5.5 and Apache 2.2. I just started to administrate my own dedicated server, but I think that I understand the concept of virtual hosts in Apache: I actually have to different domains (lets call em: and that are both served by my server.

Now I want to use Mediawiki and would like to use it with the following Url: How to I do that? As far as I understand, virtual hosts are only for complete domains, but I only want "" to serve my wiki-webpage. Here are some important information:

  • DocumentRoot is "/var/www"
  • "/var/www" contains three more folders: myDomain1, myDomain2, Mediawiki
  • I use the Kohana Framework on both domains, which usually catches all requests and wants to map them to one of its contollers
share|improve this question
BTW, the manual: – Nemo Apr 5 '15 at 22:11
up vote 0 down vote accepted

Apache is very flexible and there are multiple choices of how to do this:

  1. In /var/www, create a symlink so that wiki is an alias for Mediawiki. `ln -s /var/www/Mediawiki /var/www/wiki
  2. Alias /wiki /var/www/Mediawiki in your apache config (inside the virtualhost). This is primarily intended for things outside the document root (/var/www), but works inside, too; and it's both fast and simple.
  3. mod_rewrite. Very flexible, can do a lot of things. Also complicated.

    RewriteEngine On
    RewriteRule ^/wiki(.*)$ /Mediawiki$1

share|improve this answer
Thx for the fast response! – paskster Dec 12 '10 at 2:15
Where to I put the Rewrite code? Can I put it somewhere in my httpd.conf (where exactly?) or do I need tu put it in an .htaccess file? – paskster Dec 12 '10 at 21:15
If you've got a VirtualHost, put it in there. Other than that, it'll work in httpd or in a .htaccess file in /var/www – freiheit Dec 13 '10 at 5:21

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.