generalmediawiki

Use pretty URLs

NOTE: Pretty links have been included by default in Bitnami MediaWiki for Unix systems since version 1.22.2-1. It is not possible to include them in in Windows systems, due to the colon (:) in the Special pages URL. This is described at https://issues.apache.org/bugzilla/show_bug.cgi?id=41441.

The following steps should be performed to convert MediaWiki URLs to pretty URLs:

  • Add the following lines to the /opt/bitnami/apps/mediawiki/conf/httpd-app.conf file, inside the Directory directive

    <Directory "/opt/bitnami/apps/mediawiki/htdocs">
    ....
    RewriteEngine On
    RewriteBase /mediawiki/
    RewriteRule ^index\.php$ - [S=1]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /mediawiki/index.php [L]
    ...
    </Directory>
    
  • Add the following lines at the end of the /opt/bitnami/apps/mediawiki/htdocs/LocalSettings.php file:

    $wgArticlePath = "/mediawiki/$1";
    $wgUsePathInfo = true;
    
  • Restart the server.

All the links will now be “pretty” links.