如何防止MediaWiki将主域重定向到“主页"? [英] How to prevent MediaWiki from redirecting the main domain to the "Main Page"?

查看:69
本文介绍了如何防止MediaWiki将主域重定向到“主页"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到了很多有关如何更改MediaWiki主页的标题或如何将其重定向到另一个页面的问题,但是我似乎找不到如何1)阻止MediaWiki重定向主域的任何内容.转到主页面",然后2)在主域下显示一个独立页面.

换句话说,当您访问 www.wikipedia.org >

与其将您重定向到" http://en.wikipedia.org/wiki/Main_Page",它将在主域(www.wikipedia.org)上显示一个独立的自定义页面.

如何使用MediaWiki做到这一点?

解决方案

这实际上不是MediaWiki的问题/功能:) wikipedia.org是具有自己索引页的顶级域. en.wikipedia.org/wiki/是真实"文章路径(使用/w/作为ScriptPath).因此,如果您打开en.wikipedia.org/wiki:)

,您将被重定向到主页.

例如,如果您的Wiki安装在domain.tld/wiki/中,则只需将自己的"网页/打开器放入domain.tld/.

如果用户打开domain.tld,他将看到您的自定义页面,如果他打开domain.tld/wiki,他将被重定向到domain.tld/wiki/Main_page.

希望有帮助!

I see a lot of questions about how to change the title of a MediaWiki Main Page or how to redirect it to another page, but I can't seem to find anything on how to 1) prevent MediaWiki from redirecting the main domain to the "Main Page", and 2) display a stand-alone page under the main domain.

In other words, how to do exactly what Wikipedia does when you go to www.wikipedia.org

Instead of redirecting you to "http://en.wikipedia.org/wiki/Main_Page", it displays a stand-alone custom page on the main domain (www.wikipedia.org).

How can I do that with MediaWiki?

解决方案

This isn't really a MediaWiki issue/function :) wikipedia.org is the top level domain with an own index page. en.wikipedia.org/wiki/ is the "real" article path (with /w/ as the ScriptPath). So you will be redirected to the Main page, if you open en.wikipedia.org/wiki :)

So, e.g., if your wiki installation is in domain.tld/wiki/ you just need to place your "own" webpage/opener into domain.tld/.

If a user opens domain.tld he will see your custom page, if he open domain.tld/wiki he will be redirected to domain.tld/wiki/Main_page.

Hope that helps!

这篇关于如何防止MediaWiki将主域重定向到“主页"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆