Short URLs in MediaWiki on a localhost

From MXnet
Jump to: navigation, search

In my local installation of MediaWiki, the scripts are in <C:\wamp\www\mediawiki>.

I am using WampServer 3 (x64), but I imagine that the same principles would work on other versions.

I wanted the short URL to be <http://localhost/wiki>, followed by page names.

This is what worked for me:

In httpd.conf
alias /wiki /wamp/www/mediawiki/index.php

<Directory "/wamp/www/mediwiki">
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
In LocalSettings.php
## Base path to the directory containing the wiki;
## Cf.
$wgScriptPath       = "/mediawiki";
$wgArticlePath = "/wiki/$1";
$wgUsePathInfo = true;
This .htaccess may not be strictly necessary, but it doesn't seem to hurt.

# Enable the rewrite engine
RewriteEngine On

# Redirect / to Main Page
RewriteRule ^/*$ %{DOCUMENT_ROOT}/mediawiki/index.php [L]