1

I am an absolute beginner at MediaWiki, and just installed an instance through my hosting provider. When I create a new page on the wiki, its URL is always prefaced by index.php?title=. I wonder if this is symptomatic of where I installed MediaWiki, or relevant to a preference I could modify in local_settings? I'd like pages to look like

http://wiki.stevenarntson.com/Group_1

rather than

http://wiki.stevenarntson.com/index.php?title=Group_1
  • 1
    I might expand this into a full answer later, but does mediawiki.org/wiki/Manual:Short_URL help? – NinjaBearMonkey Feb 4 '16 at 4:42
  • This looks potentially very useful, and I see some other good advice about installation in there, too. I'm at the bottom of a big learning curve, and will set to it. Thank you for pointing me in this direction! – Steven Arntson Feb 4 '16 at 20:54
1

There's a full guide on how to do this in the MediaWiki manual: Short URL.

Essentially, you put your MediaWiki files in an unrelated directory (e.g. /w) then use the following to rewrite to the root:

RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/w/index.php [L]

To tell MediaWiki you've done this, set the following in your LocalSettings.php:

$wgScriptPath = "/w";
$wgArticlePath = "/$1";
| improve this answer | |
  • The MediaWiki manual page mentions a shortcut approach through the page http://shorturls.redwerks.org/. I went there, and followed the instructions, and it worked! Thank you. – Steven Arntson Feb 5 '16 at 18:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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