Manual:$wgUsePathInfo

From Linux Web Expert

Revision as of 18:56, 29 June 2022 by imported>Bluehill
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<translate> Server URLs and file paths</translate>: $wgUsePathInfo
Whether to use 'pretty' URLs.
<translate> Introduced in version:</translate>1.2.1
<translate> Removed in version:</translate><translate> still in use</translate>
<translate> Allowed values:</translate>(boolean)
<translate> Default value:</translate>(dynamically created)

Details

Whether to use 'pretty' URLs (or Short URL), e.g. index.php/Page_title

These often break when PHP is set up in CGI mode. PATH_INFO may be correct if cgi.fix_pathinfo is set, but then again it may not; lighttpd converts incoming path data to lowercase on systems with case-insensitive filesystems, and there have been reports of problems on Apache as well. To be safe we'll continue to keep it off by default in these instances.

Override this to false if $_SERVER['PATH_INFO'] contains unexpectedly incorrect garbage, or to true if it is really correct. It's highly recommended to set its value in LocalSettings.php to prevent inconsistencies between web requests and scripts run from the command line, where the value may change between them.

File:OOjs UI icon notice-destructive.svg <translate> Warning:</translate> The default $wgArticlePath will be set based on this value at runtime, but if you have customized it, having this incorrectly set to true can cause redirect loops when "pretty URLs" are used.

Default value

<td class="mw-version-versionbox" title="<translate nowrap> The latest stable version is <tvar name=1>1.41</tvar></translate>">
<translate> ≥</translate> 1.38.2
Gerrit change 802960
<translate> MediaWiki version:</translate>
$wgUsePathInfo = null;
<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.37</tvar> is unsupported version</translate>">
1.2.1 – 1.37
<translate> MediaWiki versions:</translate>
$wgUsePathInfo = ( strpos( PHP_SAPI, 'cgi' ) === false ) &&
	( strpos( PHP_SAPI, 'apache2filter' ) === false ) &&
	( strpos( PHP_SAPI, 'isapi' ) === false );

See also