我用这个工具http://shorturls.redwerks.org/为MediaWiki重写了一个简短的URL。 从此出发:http://wikitest.org/fr/index.php/Accueil
至此:http://wikitest.org/fr/wiki/Accueil
。如何从MediaWiki的URL中删除index.php?
Then I added this code to 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 = "/fr";
$wgScriptExtension = ".php";
$wgArticlePath = "{$wgScriptPath}/wiki/$1";
$wgUsePathInfo = true
但是,当我去我的网站,我得到404未找到。在此服务器上找不到请求的资源!
你的服务器上的重写规则是怎么样的? – leo 2014-09-25 12:14:29
我的服务器中没有重写规则。没有.htaccess我只改变了LocalSettings.php来改变URL。 – 2014-09-26 15:26:57
那就是为什么。你需要告诉服务器在这些URL上提供服务。 LocalSettings.php只能更改wiki中的链接,而不能更改服务器的行为 – leo 2014-09-26 18:35:52