如何在Mediawiki中创建Short Url?

时间:2022-12-18 01:19:02

My mediawiki's localproject name is "wiki_test".and i use following code for localsettins.php file

我的mediawiki的localproject名称是“wiki_test”。我使用以下代码来设置localsettins.php文件

$wgScriptPath = "/wiki_test";
$wgArticlePath = "/wiki/$1";
require_once("$IP/extensions/ShortUrl/ShortUrl.php"); //

and create one file in the root(means in my project folder) .htaccess file.and put following code in that

并在根目录中创建一个文件(在我的项目文件夹中表示).htaccess文件。并在其中放入以下代码

RewriteEngine On
# Short url for wiki pages
#RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/mediawiki_test/index.php/ [L]
# Redirect / to Main Page
RewriteRule ^/*$ %{DOCUMENT_ROOT}/mediawiki_test/index.php [L]

and try for short url but give error like"Object not found!". so plz give me idea........

并尝试短网址,但给出错误,如“找不到对象!”。所以PLZ给我的想法........

1 个解决方案

#1


0  

If you are placing your .htaccess in mediawiki_test directory then this code should work:

如果您将.htaccess放在mediawiki_test目录中,则此代码应该有效:

RewriteEngine On
RewriteBase /mediawiki_test/

RewriteRule ^index\.php$ - [L]

RewriteRule ^ index.php [L]

#1


0  

If you are placing your .htaccess in mediawiki_test directory then this code should work:

如果您将.htaccess放在mediawiki_test目录中,则此代码应该有效:

RewriteEngine On
RewriteBase /mediawiki_test/

RewriteRule ^index\.php$ - [L]

RewriteRule ^ index.php [L]