View Full Version : Not Logged In Redirect
MagicPID
03-14-2012, 11:35 PM
Does anyone know of a way to make it so that if you are not logged in it redirects you to an alternate login page?
My forum uses an alternate login page and not the normal vBulletin login, so I was wondering if I could make it so that they can't go to /forums/ at all if they are not logged in. (Currently it just says to log in and shows the default login)
Thanks
MagicPID
03-17-2012, 05:44 AM
Bumping this---
Simon Lloyd
03-17-2012, 06:36 AM
Put this at the top of your header template<if condition="$bbuserinfo['usergroupid'] == 1">
<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.mysite.com/register.php">
</if>
of course you need to change the url but anyone viewing your site who are not logged in will be redirected there.
MagicPID
03-17-2012, 06:43 AM
Put this at the top of your header template<if condition="$bbuserinfo['usergroupid'] == 1">
<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.mysite.com/register.php">
</if>
of course you need to change the url but anyone viewing your site who are not logged in will be redirected there.
While this does work, when I send out an invitation to my site the user is given a link to register.php and the code here redirects even the register.php page, is there a way to exclude that page so that they can still join?
Simon Lloyd
03-17-2012, 04:56 PM
Try this instead <if condition="THIS_SCRIPT != 'register' AND is_member_of($bbuserinfo,1)">
<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.mysite.com/register.php">
</if>
MagicPID
03-17-2012, 06:52 PM
Try this instead <if condition="THIS_SCRIPT != 'register' AND is_member_of($bbuserinfo,1)">
<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.mysite.com/register.php">
</if>
This worked perfectly!
Thanks, I appreciate it.
MagicPID
03-19-2012, 12:10 AM
One final issue, I still want my users to be able to use the lost password php which is found under /forums/login.php?do=lostpw, the only problem is it's situated within the login.php and the whole point of this thread was to avoid users being able to access that.
Is there a way to let users only access that part of the login.php?
Simon Lloyd
03-19-2012, 07:53 AM
Not that i can think of off hand, but you could always put the lost password link at your redirected location...........but i'll have a think about it :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.