php – Web根目录中Mediawiki安装的简短URL

我在我的Web根目录上运行了Mediawiki安装.例如.主页面可以通过访问

http://example.com/index.PHP?title=Main_Page

我想改变它,以便短URL

http://example.com/Main_Page

我的配置如下

#.htaccess
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^(.*)$/index.PHP?title=$1 [PT,L,QSA]
RewriteRule ^.*$/index.PHP [L,QSA]

.

// LocalSettings.PHP
$wgScriptPath = "..";
$wgArticlePath = "/$1";
$wgUsePathInfo = true;

但是这个配置我得到500错误.

这是一个服务器,其中有一个〜/ user_root /文件夹.该文件夹包含用户根域的公共HTML文件,例如user-root.com.

文件夹包含多个子文件夹,例如在这种情况下〜/ user_root / example,可以通过上面提到的URL,example.com访问.

问题是基于此文件夹/子文件夹层次结构和$wgScriptPath设置吗?应该

$wgScriptPath = "..";

被这个相对路径以外的其他东西取代?如果您需要更多信息,请告知.

解决方法:

是的,您的$wgScriptPath是错误的.使用:

$wgScriptPath = "/";

你的重写规则似乎也不太可能是你想要的,尤其是^.* $/index.PHP(尽管它可能是无害的,即将到来).

If you are using a root url instead of a normal short url you will need to use the following
instead (to ensure that existing files and directories are not seen as article, e.g. “/index.PHP” “/images” etc.):

06001

(Source)

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...