Mediawiki 中禁止匿名用户访问

可以在 LocalSettins.php 的最后添加下面的内容:[code]# Disable reading by anonymous users
$wgGroupPermissions[‘*’][‘read’] = false;

But allow them to access the login page or else there will be no way to log in!

NOTE: You also need to provide access here to the .css and .js files that the

allowed pages attempt to load; otherwise, users will get errors on the page

when they attempt to load it (Internet Explorer will complain about the errors;

Firefox will show them in its error console)

[You also might want to add access to “Main Page”, “Wikipedia:Help”, etc.)

$wgWhitelistRead = array (“首页”, “Main Page”, “Special:Userlogin”, “MediaWiki:Common.css”, “MediaWiki:Common.js”, “MediaWiki:Monobook.css”, “MediaWiki:Monobook.js”, “-”);[/code]但是同时,你也需要指定一些页面是可以不需要注册就可以访问的,你可以添加页面的名称到白名单列表里面。