我在Apache上的设置:
我将Mediawiki放在/var/www/sandbox.example.org/wiki文件夹中,然后进行安装。
LocalSettings.php自动获得:$wgScriptPath = "";
作为浏览器中的URL,我得到:https://sandbox.example.org/index.php?title=MainPage
我想要的:https://sandbox.example.org/wiki/MainPage
我在https://www.mediawiki.org/wiki/Manual:Short_URL/Apache上遵循/尝试了指令,但没有效果。
怎么做?
发布于 2022-01-05 20:18:34
找到解决办法了!对于那些感兴趣的人:
在虚拟主机配置文件中,标记中有以下内容:
DocumentRoot /var/www/sandbox.example.org
DirectoryIndex w/index.php
RewriteEngine On
RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]在LocalSettings.php的MediaWiki安装中:
$wgArticlePath = "/wiki/$1";
$wgUsePathInfo = true;所以现在我有了:http://sandbox.example.org/wiki/MainPage而不是http://sandbox.example.org/w/index.php?title=MainPage。
https://stackoverflow.com/questions/70531035
复制相似问题