手册:$wgSend404Code

From mediawiki.org
Jump to navigation Jump to search
This page is a translated version of the page Manual:$wgSend404Code and the translation is 38% complete.
Outdated translations are marked like this.
Other languages:
English • ‎español • ‎français • ‎magyar • ‎português do Brasil • ‎中文 • ‎日本語
输出: $wgSend404Code
Send 404 HTTP status for not found pages.
引进版本:1.19.0 (r105645)
移除版本:仍在使用
允许的值:(布尔值)
默认值:true

细节

网页服务器支持没发现请求的页面时发送404响应。如果有人想加载一个不存在的页面的话,Mediawiki会响应404。注意,编辑不存在的页面是不会响应404的。一些网页服务器托管商会拦截404响应而显示为“友好的”404响应页,这挺烦人的。而另一些网页服务器托管商在拦截404响应会出现错误,输出一堆垃圾信息。这两种情况,你可以考虑换个网页服务器托管商,如果实在不行,这个设置会帮到你。 If someone tries to load an article that doesn't exist, MediaWiki sends a 404 status. (Note, editing an article that doesn't exist does not send a 404 status) Some webservers try to intercept 404 responses and give "helpful" 404 response pages, which is quite annoying. Some webservers get the 404 intercepts severely wrong, causing garbage to be output. In either case, you should consider looking for a new web host, but if that's not an option then this setting can work around the issue.

In cases where for technical reasons it is more important for MediaWiki to send the correct status code than for the body to be transmitted intact, this configuration variable is ignored

更改

自从MediaWiki 1.28 版本后,这个设置也对“action=history”有效。