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

Make Q2A site private except for login and forgot page

+2 votes
404 views
asked Jun 28, 2015 in Q2A Core by case42
edited Jun 28, 2015 by case42

I'm using the code shown below in qa-app-users.php  ( the $qa_logged_in_userid_checked=true; function)

..which makes the site private..  but this means users can't get to the forgot password page when they are not logged in..   

how do i create an exception to the redirect for  www.someQ2Asite.com/forgot   ... ? 

thanks much ! 

if (

    (empty($_SESSION['qa_session_userid_'.$suffix]))

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

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

              qa_redirect_raw('login');

 }

Q2A version: 1.6

1 Answer

0 votes
answered Nov 27, 2017 by Art Attack
Look at https://github.com/JackSiro/Q2A-Closed-Site-Plugin. For me (V1.7) this plugin works for this purpose. In qa-closed-layer.php you can exclude the Ā»forgotĀ«page.
...