Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-12-2009, 05:57 PM
hymoo hymoo is offline
 
Join Date: Nov 2008
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Redirect Question

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!
Reply With Quote
  #2  
Old 02-12-2009, 06:26 PM
ZomgStuff ZomgStuff is offline
 
Join Date: Feb 2007
Posts: 469
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

.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
PHP Code:
if ($_SERVER['HTTP_USER_AGENT'] != "adminOnlyUserAgent") {
     
header'Location: www.site.com/blabla/' );

Firefox User Agent Switcher Plugin: https://addons.mozilla.org/en-US/fir...=firefox&id=59
Safari/Firefox Configuration User Agent Spoof: http://www.rubyrobot.org/article/spo...ari-or-firefox
Reply With Quote
  #3  
Old 02-12-2009, 07:10 PM
hymoo hymoo is offline
 
Join Date: Nov 2008
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you also explain me more about the htaccess way please?
Reply With Quote
  #4  
Old 02-13-2009, 08:06 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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).
Reply With Quote
  #5  
Old 02-13-2009, 02:19 PM
UKBusinessLive UKBusinessLive is offline
 
Join Date: Sep 2008
Location: Essex, United Kingdom
Posts: 1,637
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by hymoo View Post
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

Code:
<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

Hope that helps
Reply With Quote
  #6  
Old 02-14-2009, 05:21 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You probably want (note the operator):
Code:
<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.
Reply With Quote
  #7  
Old 02-14-2009, 06:31 AM
ragtek ragtek is offline
 
Join Date: Mar 2006
Location: austria, croatia
Posts: 1,630
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

And how you want to log in?
Reply With Quote
  #8  
Old 02-14-2009, 09:22 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Now, that, is a good question.
Reply With Quote
  #9  
Old 02-14-2009, 12:35 PM
ragtek ragtek is offline
 
Join Date: Mar 2006
Location: austria, croatia
Posts: 1,630
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could take this: https://vborg.vbsupport.ru/showthread.php?t=156992 and modify it a little bit
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:49 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.10125 seconds
  • Memory Usage 2,245KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete