Mediawiki Short URLs not working

I have installed MediaWiki into a subdomain at I have tried to configure short URLs using the following three methods, none of which have worked.

  1. I have tried the instructions I found here

  2. and here

  3. and here

and each time, when I access my wiki at, I get the following error:

[color=#000080]Not Found

The requested URL /Main_Page was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.[/color]

Additionally, when I use method #3, and try to access just, I get this error:

[color=#000080]Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.[/color]

If I delete the htaccess file, I can still access my wiki at:

Can anyone tell me what I am doing wrong? I am assuming that the root directory of my wiki is actually (when using my FTP client), and that is where I have been installing the htaccess file. Should it go elsewhere?

I’m not a total noob, since I was able to change the default image, but this one really has me stumped.



Here’s what the .htaccess for looked like before it was moved to nginx:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?title=$1 [PT,L,QSA]

With the following entry set in LocalSettings.php:

$wgArticlePath = "$wgScriptPath/$1";

Thanks, Andrew, but that doesn’t seem to work either. Still stumped.

I know this is old, but I wanted to say THANK YOU for your reply from last year. The short URL info and rewrite info is SO fragmented and different everywhere that I had no clue what I should be putting where. This got me going.


I’m also having a problem setting up short url’s with mediawiki, but I’m not getting the same errors as OP. When following the instructions for .htaccess from the mediawiki website, nothing happens. And when I follow the instructions from andrewf above, I think the url shortening may be working, but there’s some kind of looping error and I get error 500. Can someone please explain how they got this to work?

I’m not sure why, but I have managed to get short URL’s working, using the code Andrew provided.

I did uninstall and reinstall mediawiki, but I don’t think that had anything to do with it. More likely, I had somehow corrupted my LocalSettings.php file.

My .htaccess file contains only the items listed by Andrew.

The relevant portion of my LocalSettings.php file looks like this:

[code]## The URL base path to the directory containing the wiki;

defaults for all runtime URL paths are based off of this.

For more information on customizing the URLs please see:

$wgScriptPath = “”;
$wgScriptExtension = “.php”;

Added by me to enable pretty permalinks

$wgArticlePath = “$wgScriptPath/$1”;

It works. You can see it here.