【发布时间】:2016-04-26 18:24:08
【问题描述】:
我在我的网站上安装了 mediawiki。我的 wiki 页面以 www.mywebsite/mywiki/index.php/mywikipage 开头时遇到了问题。我想摆脱这个“index.php”,所以我用这个网站创建了我的 wiki 的短网址:http://shorturls.redwerks.org/。从这里我得到一个 .htaccess 的代码:
DirectoryIndex RewriteEngine On
RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]
RewriteRule ^/?$ %{DOCUMENT_ROOT}/w/index.php [L]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^/?w/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/w/thumb.php?f=$1&width=$2 [L,QSA,B]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^/?w/images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/w/thumb.php?f=$1&width=$2&archived=1 [L,QSA,B]
我的wiki文件夹中的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 = "/w";
$wgScriptExtension = ".php";
$wgArticlePath = "/wiki/$1";
$wgUsePathInfo = true;
## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
$wgEnableUploads = true;
$wgGenerateThumbnailOnParse = false;
在此之后,我的 wiki 页面的 URL 不再有问题。但是我的网站首页现在转到 wiki。我希望它回到 index.html。我尝试将此代码放入我的 .htaccess 文件中,但仍然无法正常工作。
Options +FollowSymlinks
RewriteEngine on
RewriteBase /
DirectoryIndex index.html
任何帮助都会很棒!谢谢!
【问题讨论】: