Short URL to install Mediawiki in the web root

I have a Mediawiki installation running on my web root. For example. the main page can be accessed via


I would like to change it so that the short url is


My config looks like this

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^(.*)$ /index.php?title=$1 [PT,L,QSA]
RewriteRule ^.*$ /index.php [L,QSA]



// LocalSettings.php
$wgScriptPath = "..";
$wgArticlePath = "/$1";
$wgUsePathInfo = true;


But I am getting 500 error with this configuration.

This is the server that has the folder ~/user_root/

. This folder contains the public HTML files for the user's root domain, for example.


The folder contains several sub-folders eg. In this case ~/user_root/example

, available at the URL above,


Is the problem based on this folder / subfolder hierarchy and parameter $wgScriptPath

? If

$wgScriptPath = "..";


replace with something other than this relative path? Please advise if you need more information.


source to share

1 answer

Yes, yours $wgScriptPath

is wrong. Using:

$wgScriptPath = "/";


Your rewrite rules also seem unlikely to you, especially that ^.*$ /index.php

(although it may be harmless, the last one).

If you are using the root URL instead of the normal short URL, you will need to use the following instead (to ensure that existing files and directories are not treated as an article, such as " /index.php

" " /images

" etc.):

RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/w/index.php [L]


( Source )



All Articles