View Full Version : Redirect Question
hymoo
02-12-2009, 05:57 PM
Hi,
I have a question. We are developing our forum but we want to redirect all visitors
to a certain page until we launch our site.
Oke what we want is this:
When someone comes to www.site.com he has to be redirected to www.site.com/blabla/
but the normal admins should be able to access the normal site.
We dont wanna do it through ip adresses since one of us has dynamic ips
We also have vbseo installed. So we dont want anyone to see any of our sites pages only
the redirectionpage.
Can you tell me how we can manage this since we have something up and running now
but it doesnt work flawlessly.
Please help us!
ZomgStuff
02-12-2009, 06:26 PM
.htaccess would be the way to go. Another way you could do it is by having a index.php that checks your User Agent (there are firefox plugins that let you spoof your user agent to be anything) to be "XXX", and if not, it redirects you to another page.
So you could have something like
if ($_SERVER['HTTP_USER_AGENT'] != "adminOnlyUserAgent") {
header( 'Location: www.site.com/blabla/' );
}
Firefox User Agent Switcher Plugin: https://addons.mozilla.org/en-US/firefox/addon/59?application=firefox&id=59
Safari/Firefox Configuration User Agent Spoof: http://www.rubyrobot.org/article/spoofing-the-user-agent-for-awstats-with-safari-or-firefox
hymoo
02-12-2009, 07:10 PM
Can you also explain me more about the htaccess way please?
Dismounted
02-13-2009, 08:06 AM
You should just use vBulletin plugins to redirect, as it does not require spoofing UAs, etc. .htaccess redirects do not know who you are (vBulletin user-wise).
UKBusinessLive
02-13-2009, 02:19 PM
Hi,
I have a question. We are developing our forum but we want to redirect all visitors
to a certain page until we launch our site.
Oke what we want is this:
When someone comes to www.site.com he has to be redirected to www.site.com/blabla/
but the normal admins should be able to access the normal site.
We dont wanna do it through ip adresses since one of us has dynamic ips
We also have vbseo installed. So we dont want anyone to see any of our sites pages only
the redirectionpage.
Can you tell me how we can manage this since we have something up and running now
but it doesnt work flawlessly.
Please help us!
How about this
<if condition="$bbuserinfo['usergroupid'] == X">
<meta HTTP-EQUIV="REFRESH" content="0; url=www.site.com/blabla">
</if>
Relace X with the number of the Usergroup ID that you want to redirect, and then place it at the top of your header, Then when a member goes to your site that falls into that usergroup, they will be redirected automatically ;)
Alot easier than .htaccess editing :D
Hope that helps
Dismounted
02-14-2009, 05:21 AM
You probably want (note the operator):
<if condition="$bbuserinfo['usergroupid'] != 6">
<meta http-equiv="refresh" content="0; url=www.site.com/blabla">
</if>
You should place this into the headinclude template, as meta tags should be placed in the <head> element.
ragtek
02-14-2009, 06:31 AM
And how you want to log in?:D
Dismounted
02-14-2009, 09:22 AM
Now, that, is a good question. ;)
ragtek
02-14-2009, 12:35 PM
You could take this: https://vborg.vbsupport.ru/showthread.php?t=156992 and modify it a little bit
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.