如何将我的索引指向 MediaWiki index.php

How to direct my index to MediaWiki index.php

老实说,我对这一切都是陌生的,我什至不确定我问的问题是否正确。基本上我有一个 LAMP 服务器设置到 运行 mediawiki。我可以通过输入 localhost/Wiki 来访问,但我只需要使用 localhost,它会带我到 wiki 的主页。现在,当我输入它时,我只得到一个文件浏览器(我从 /var/www/html 中删除了默认的 apache2 index.html。另一个要添加的注释是我的 Wiki index.php 在 /var/www/html/ Wiki/index.php。让我知道这个问题是否可以理解,因为我是新手。

感谢您的宝贵时间!

实现此目的的正确方法是在 /var/www/html

上安装 mediawiki

但这里有一种快速而肮脏的重定向方法。

使用以下行创建文件 /var/www/html/index.html

<html><head><title>redirect</title>
<META http-equiv="refresh" content="0;URL=http://localhost/Wiki">
</head><body></body></html>

因此,当您转到 http://localhost 时,您将被重定向到 http://localhost/Wiki

您需要设置URL rewriting (which is a way to tell the webserver how to translate the URL into a file system path - the default is something like <URL path> -> /var/www/html/<URL path> but you can do almost anything with the right configuration). There is a MediaWiki URL rewriting guide but if your wiki is accessible from the internet it's easier to use the Redwerks short URL builder