Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8150817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:10:48+00:00 2026-06-06T15:10:48+00:00

I am trying to setup a private Mediawiki instance which expects users to login

  • 0

I am trying to setup a private Mediawiki instance which expects users to login to see any content. I tried tweaking the $wgWhitelistRead variable in the Localsettings.php file but it still takes me to a page that says, “Login Required”. I want the wiki to redirect to Special:userLogin if a user is not logged in. How do I do this?

I found a similar question on the mwforums but it seems to be for an older version of mediawiki. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T15:10:50+00:00Added an answer on June 6, 2026 at 3:10 pm

    The seemingly natural place to do this would be in OutputPage::showPermissionsErrorPage(). Specifically, the actual error message is displayed in the following two lines:

    $this->prepareErrorPage( $this->msg( 'loginreqtitle' ) );
    $this->addHTML( $this->msg( $msg )->rawParams( $loginLink )->parse() );
    

    To redirect directly to Special:UserLogin, you could replace them with something like this (untested!) code:

    $this->redirect( SpecialPage::getTitleFor( 'Userlogin' )->getFullURL( $query ) );
    

    Alas, there doesn’t seem to be any convenient hook in place that would let you do this from an extension, so it looks like you’ll have to resort to patching the code. This does look like a natural place for a hook, so it might not be a bad idea to file a feature request asking that such a hook be added.

    (Alternatively, you could indeed output a login form in place, but that might be a bit trickier to implement than just redirecting to Special:UserLogin. At a glance, I couldn’t find any convenient “outputLoginForm()” method to call in the Special:UserLogin code, and while it’s not actually hard to generate a matching login form yourself, that would mean that any later changes to the form might break compatibility.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to setup a private beta for a site that I'm working on.
I was trying to setup a unit test for a private inner class, but
I'm basically trying to setup my own private pastebin where I can save html
I'm trying to setup a git client on linux. I uploaded my private key
I have a console application for which I am trying to setup logging with
I'm trying to setup a bean factory in spring, something which should be really
I am trying to setup an sbt instance installed with the typesafe stack to
Trying to setup a CodeIgniter based project for local development (LAMP stack), and once
Trying to setup some validation on the add to cart button for the dropdown
Trying to setup and get going with the RestKit library for a cocoa project

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.