【发布时间】:2014-09-24 19:23:26
【问题描述】:
我使用这个工具http://shorturls.redwerks.org/ 为MediaWiki 重写了一个短网址。
从这个:http://wikitest.org/fr/index.php/Accueil 到这个:http://wikitest.org/fr/wiki/Accueil。
然后我将此代码添加到 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 Not Found。在此服务器上找不到请求的资源!
【问题讨论】:
-
你服务器上的重写规则是怎样的?
-
我的服务器中没有重写规则。没有.htaccess 我只更改了LocalSettings.php 来更改URL。
-
那就是为什么。你需要告诉你的服务器在这些 url 上提供一些东西。 LocalSettings.php 只能更改 wiki 中的链接,不能更改服务器的行为