Korogodin/Настройка pretty URL — различия между версиями
Материал из SRNS
Korogodin (обсуждение | вклад) м |
Korogodin (обсуждение | вклад) м |
||
Строка 5: | Строка 5: | ||
В LocalSettings.php: | В LocalSettings.php: | ||
− | < | + | <nowiki>## The URL base path to the directory containing the wiki; |
− | ## 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: | ||
Строка 12: | Строка 11: | ||
$wgScriptPath = ""; | $wgScriptPath = ""; | ||
$wgArticlePath = "/wiki/$1"; | $wgArticlePath = "/wiki/$1"; | ||
− | $wgUsePathInfo = true; | + | $wgUsePathInfo = true;</nowiki> |
− | </ | + | |
'''Второе''' | '''Второе''' | ||
Строка 19: | Строка 17: | ||
В той же папке в .htaccess добавлено в конец: | В той же папке в .htaccess добавлено в конец: | ||
− | < | + | <nowiki>RewriteEngine On |
− | 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] | + | 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]