Make your MediaWiki Wiki Private

From SWCP Support Wiki
Jump to navigationJump to search

By default, people have to log in to your wiki to be able to edit pages, but anybody can read the wiki. But what if you want the wiki to be private so that people have to log in to read pages as well as edit them? Here's how.

  • Edit your Localsettings.php file to add these lines:
#Disable reading line, for anonymous (not-logged-in => * ) :
$wgGroupPermissions['*']['read'] = false;

# ... and enable anonymous to read the followings pages :
$wgWhitelistRead = array("Main Page", "Special:Userlogin", 
                         "-", "MediaWiki:Monobook.css" );

Now anybody on the net can access the main page and the User Login page of your wiki. But to follow any of the links deeper into your wiki, they will need to log in first. Be sure to try this out after you set it up to make sure it's working the way you expect. If you visit your wiki main page, then click a link to more content, you should receive a message that you have to log in. Now log in to the wiki and verify that you can now follow those links.

Note that the entire world can still see your Main Page. If your wiki content is very sensitive, you may want to make the Main Page be very sparse, obfuscated, or enigmatic.