Korogodin/Настройка pretty URL — различия между версиями
Материал из SRNS
Korogodin (обсуждение | вклад) м |
Korogodin (обсуждение | вклад) |
||
Строка 6: | Строка 6: | ||
<nowiki>## The URL base path to the directory containing the wiki; | <nowiki>## The URL base path to the directory containing the wiki; | ||
+ | |||
## defaults for all runtime URL paths are based off of this. | ## defaults for all runtime URL paths are based off of this. | ||
+ | |||
## For more information on customizing the URLs please see: | ## For more information on customizing the URLs please see: | ||
+ | |||
## http://www.mediawiki.org/wiki/Manual:Short_URL | ## http://www.mediawiki.org/wiki/Manual:Short_URL | ||
+ | |||
$wgScriptPath = ""; | $wgScriptPath = ""; | ||
+ | |||
$wgArticlePath = "/wiki/$1"; | $wgArticlePath = "/wiki/$1"; | ||
+ | |||
$wgUsePathInfo = true;</nowiki> | $wgUsePathInfo = true;</nowiki> | ||
Строка 18: | Строка 24: | ||
<nowiki>RewriteEngine On | <nowiki>RewriteEngine On | ||
+ | |||
RewriteRule ^wiki/(.*)$ /index.php?title=$1 [PT,L,QSA] | RewriteRule ^wiki/(.*)$ /index.php?title=$1 [PT,L,QSA] | ||
+ | |||
RewriteRule ^wiki/*$ /index.php [L,QSA]</nowiki> | RewriteRule ^wiki/*$ /index.php [L,QSA]</nowiki> | ||
{{wl-publish: 2011-04-02 12:32:11 +0400 | Korogodin }} | {{wl-publish: 2011-04-02 12:32:11 +0400 | Korogodin }} |
Версия 17:05, 2 апреля 2011
Задача решена в два действия. --more-- Первое:
В LocalSettings.php:
## 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: ## http://www.mediawiki.org/wiki/Manual:Short_URL $wgScriptPath = ""; $wgArticlePath = "/wiki/$1"; $wgUsePathInfo = true;
Второе
В той же папке в .htaccess добавлено в конец:
RewriteEngine On RewriteRule ^wiki/(.*)$ /index.php?title=$1 [PT,L,QSA] RewriteRule ^wiki/*$ /index.php [L,QSA]