Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 06-07-2004, 12:48 PM
mOdEtWo mOdEtWo is offline
 
Join Date: Dec 2003
Location: Norway
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Changing host, need to forward users with php code

Ok, this is the case:

Since we've been using too much bandwidth on our dedicated server lately, we have to move the forums to another host with cheaper bandwidth. I've already bought and configured this, and I set up a new domain for the forums.

So, what I need to do when changing host, is to redirect users to the new host. I was going to use a .htaccess file with the Redirect setting, but Apache on that server doesn't allow such settings in .htaccess files. So, I need to figure out something else.

We have just released a new piece of software (game actually), and we're getting linked to from everywhere (even slashdot ). So I can't just delete the vB forums off the dedicated server and breake the links. I *need* to sort something out here.

Floris answeared me on the official forums, and told me to try:
PHP Code:
<?php
header
("Location: http://www.yournewsite.com/forum/");
?>
I then figured I could replace all other code with this code in the common php files that get linked to from other places, like showthread.php, index.php etc.

So now, when a user visits myolddomain.com/forums, they get forwarded to mynewdomain.com/forums. So far so good. But when they are linked to a spesific thread, like myolddomain.com/forums/showthread?t=3813, they are still just forwarded to mynewdomain.com/forums, and not to the spesific thread.

I told Floris this, and he told me to try:
PHP Code:
if ($_REQUEST)
{
header("Location: http://www.yournewsite.com/forum/");
}
if (empty(
$_REQUEST))
{
header("Location: http://www.yournewsite.com/forum/");

And then he said:
Quote:
Originally Posted by Floris
As you can see in the code, it doesn't include any thread id catching, etc.
If the above code works, catch the id and set it to a variable, then add the variable to the end of the header.location url.
Now, how do I do that!? I want myolddomain.com/forums/showthread?t=3813 to be forwarded to mynewdomain.com/forums/showthread?t=3813
Reply With Quote
  #2  
Old 06-07-2004, 05:22 PM
mOdEtWo mOdEtWo is offline
 
Join Date: Dec 2003
Location: Norway
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Too much text to read for ya, eh?

Reply With Quote
Reply

Thread Tools
Display Modes

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 01:28 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.04358 seconds
  • Memory Usage 2,164KB
  • Queries Executed 11 (?)
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_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (2)postbit
  • (2)postbit_onlinestatus
  • (2)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_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