Manual:URL corta/LocalSettings.php

This page is a translated version of the page Manual:Short URL/LocalSettings.php and the translation is 44% complete.

This solution should pertain to everyone who uses Apache with MediaWiki installed directly within the directory (folder) that Apache uses to retrieve files for your website. The only thing you need to know before you get started is what your website address is and where your MediaWiki is installed. You may use this in combination with aliasing and/or rewrite rules.

Your website address may look like any of the follow:

  • subdomain.example.com/Page_Name
  • subdomain.example.com/wiki/Page_Name
  • subdomain.example.com/w/index.php?title=Page_Name&action=edit
  • subdomain.example.com/~user/Page_Name
  • subdomain.example.com/~user/wiki/PageName
  • subdomain.example.com/~user/w/index.php?title=Page_Name&action=edit

Opciones

In order for your short addresses to work you will need to adjust some settings in LocalSettings.php :

Mirada rápida en opciones
poniendo valor predeterminado descripción
$wgScriptPath "/wiki" Where MediaWiki is installed
$wgScript "{$wgScriptPath}/index.php" Where MediaWiki's main script is located. Don't touch unless you've renamed and/or moved index.php
$wgArticlePath "{$wgScript}?title=$1", o "{$wgScript}/$1" (depends on value of $wgUsePathInfo) How article links internal to MediaWiki are constructed
$wgUsePathInfo false if php is running as a cgi module, true otherwise Whether to use pretty URLs like index.php/Page_title or not

All values are relative paths using the base URL of the website, and may refer to paths that are changed as a result of aliasing or rewrite rules. Under most cases you should only need to change three options:

con /wiki sin /wiki
$wgScriptPath = "/w";
$wgArticlePath = "/wiki/$1";
$wgUsePathInfo = false; # no necesita con anterioridad a 1.11.x
$wgScriptPath = "/w";
$wgArticlePath = "/$1";
$wgUsePathInfo = false; # no necesita con anterioridad a 1.11.x