Mediawiki子目录安装 [英] Mediawiki Subdirectory Installation
问题描述
可能重复:: SubDirectory和SubDomain上的MediaWiki (但是没有答案,也没有提供帮助的答复)
Possible Duplicate: MediaWiki on SubDirectory and SubDomain (However doesn't have an answer, nor any replies offering help)
好的,我正在尝试配置MediaWiki以将其安装到子目录中.我以前曾使用mod_rewrite将它安装到 http://www.example.com/上的主域中使用/wiki/Main_Title
的短网址.
Alright, I'm trying to configure MediaWiki to be installed to a sub-directory. I previously had it installed to a primary domain on http://www.example.com/ with a mod_rewrite using a Short URL of /wiki/Main_Title
.
请注意,我也在特殊规则的共享托管表示短网址.
As a note, I'm also on HostGator shared hosting which has special rules for short urls.
我的目录结构是这样的:
My directory structure is as such:
-
/
(站点根; .htaccess的位置)
-
/wiki/
(mediawiki根; LocalSettings.php的位置)
这是我尝试过的,
.htaccess
:
.htaccess
:
RewriteEngine on
RewriteBase /
RewriteRule ^(.*)\&(.*)$ $1\%26$2
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^wiki/(.+)$ ./wiki/index.php?title=$1 [PT,L,QSA]
/wiki/LocalSettings.php
:
/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 = "/wiki";
$wgScriptExtension = ".php";
$wgArticlePath = "$wgScriptPath/$1";
但是,我什么也没得到.我只是得到一个 403/Forbidden
错误;否 500 Internal Server Error
(仅500)- url http://www.example.com/ .好像什么也没做.我把头撞在墙上,试图弄清楚这一点.感谢您的帮助.
However, I do not get anything. I simply get a 403/Forbidden
error; no 500 Internal Server Error
, just a 403 - url http://www.example.com/. It's as if there's nothing being done. I've banged my head against the wall trying to figure this out. Any help is appreciated.
谢谢!
推荐答案
我的HostGator票务解决了该问题,尽管没有帮助.我希望有一个单个 .htaccess
解决方案,而不是一个双重的 .htaccess
重定向/重写.但是,这是我的解决方法.
My ticket to HostGator resolved the issue, albeit un-helpfully. I was hoping for a single .htaccess
solution, rather than a double .htaccess
redirect/rewrite. However, here's my solution.
/
:
/
:
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^.*$ http://www.example.com/wiki/
/wiki/
:
/wiki/
:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?title=$1 [L,QSA]
这篇关于Mediawiki子目录安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!