vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Redirect Question (https://vborg.vbsupport.ru/showthread.php?t=205164)

hymoo 02-12-2009 05:57 PM

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!

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

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

Quote:

Originally Posted by hymoo (Post 1742137)
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 :D

Hope that helps

Dismounted 02-14-2009 05:21 AM

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.

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


All times are GMT. The time now is 10:51 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01209 seconds
  • Memory Usage 1,732KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete