Manual:$wgSecureLogin/zh

细节
如果为真，强制用户若来自http在认证时使用https，但仅在 中使用协议相对URL有效（否则该设置将被忽略）. Note also that under certain circumstances, when serving http and https in parallel on a web server, specifying http within a browser's location and adding the  query parameter, the login page will be downgraded from https to http, even when   is set to true. A link will then display above the username field allowing a user to choose the secure login option.

从1.22版本开始，如果您希望HTTP用户在登录后保持HTTP状态，使用 将 的默认值设置为false.

基于George Herbert在wikitech-l上的想法（wikitech-l/2010-October/050071.html）.

您需要将$wgServer按照如下设置.