Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

Private Q&A?

+9 votes
asked Apr 2, 2011 in Q2A Core by gatorfan
How can I create a private installation of Q2A for use as a members only board?

In other words, I don't want guests/non-members to be able to see questions and answers.
commented Apr 3, 2011 by gatorfan
Anyone have any idea on a workaround assuming this isn't a built in feature?

2 Answers

+1 vote
answered Apr 4, 2011 by snoopy0815

this should do the trick:

open qa-include/qa-app-users.php

search for $qa_logged_in_userid_checked=true;

add this:

if ((!@$_SESSION['qa_session_userid'])&&(!isset($_GET["x"]))){
  if ($_GET["qa"]=="register")


now you'll get automatically redirected to the login page - if you're not logged in...

There is just one problem: unfortunately I can't read out the parameter "qa" at this place -- so new users are not able to register - also they will be redirected to login instead of to register page...
...and I don't know why...

Any hints from other users?



commented Jul 11, 2011 by coolpishu
I am also facing the same issue ...any idea????
commented Jul 11, 2011 by coolpishu
There seems to be issue because of this http://localhost/qa/?qa=register&to=%3Fqa%3Dlogin%26x%3D,....as qa is set to login again...

Please check
commented Jul 21, 2011 by marcink99
hey did ever figure it out? If yes could you please post the code?
commented Jul 24, 2011 by gidgreen
Version 1.4 allows you to make questions viewable by registered users only.
commented Jul 24, 2011 by marcink99
It still allows to view questions just not answers. I want whole site to be restricted till users logs in.
+2 votes
answered Dec 2, 2014 by kourryel


Based on a previous answer from  snoopy0815 (and thank you btw) , here's a version of the trick working with version 1.6.3 : 


open qa-include/qa-app-users.php

search for $qa_logged_in_userid_checked=true;

add this:

if (


    && ($_REQUEST["qa-rewrite"]!="login")

    && ($_REQUEST["qa-rewrite"]!="register")){