Is there any way to do this in the server configuration, rather than
in MediaWiki? Just tell the server to always use https for that
particular page. (This may well be impossible, especially since the
request is initiated by the user, not the server, but if it's
possible, it would be easier than hacking MediaWiki.)