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-02-2007, 11:46 PM
Burgy Burgy is offline
 
Join Date: Aug 2002
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Small Hack 301 header for threads in certain forums

Actually out of one Forum becaume two. Now the one stays behind while the other moves to a new domain. Therefore I want to redirect the showthreads and forumdisplays to the new domain. The kriteria wheather to move shell be a list of forumids that have moved eg:
  • Redirects if forumhome or thread of the following forumids: 41, 25, 28, 30, 34, 38, 36, 37, 23, 29, 32, 27, 35, 39, 33, 89, 79, 90, 31
  • I want to use this code
    PHP Code:
    if ($forumid == "41" or $forumid == "25" or $forumid == "28" or $forumid == "30" or $forumid == "34" or $forumid == "38" or $forumid == "36" or $forumid == "37" or $forumid == "23" or $forumid == "29" or $forumid == "32" or $forumid == "27" or $forumid == "35" or $forumid == "39" or $forumid == "33" or $forumid == "89" or $forumid == "79" or $forumid == "90" or $forumid == "31") {
    // the forumdisplay.php?.... and showthread.php?..... url 
    // shall be cut out in order to be put in into the header location again $headerurl
      
    $goto ='www.your new server.de';
      
    $goto.='/new extra subdir';
      
    $goto.=$headerurl;

      
    header("HTTP/1.1 301 Moved Permanently");
      
    header("Location: http://www.newsolutions.de/forum-systemi-as400-i5-iseries/".$headerurl);
      exit;



???????????????????????????????1
How do I get the forumid in the forumdisplay.php and showthread.php

???????????????????????????????2
How do I extract one part of the url and put it in the variable $headerurl


Please help, I want to move the pagerank of about 30 thousend google entries!


Sincerely your from Berlin
Burgy Zapp
vB Version 3.64 compatible


Here is the code for the showthread.php and forumdisplay.php
post directly above the hook code (search for hook)

PHP Code:

// HACK RLP 301 move to DUKE
if ($forumid == "41" or $forumid == "25" or $forumid == "28" or $forumid == "30" or $forumid == "34" or $forumid == "38" or $forumid == "36" or $forumid == "37" or $forumid == "23" or $forumid == "29" or $forumid == "32" or $forumid == "27" or $forumid == "35" or $forumid == "39" or $forumid == "33" or $forumid == "89" or $forumid == "79" or $forumid == "90" or $forumid == "31") {

  
$goto ='www.your new server.de';
  
$goto.='/new extra subdir';
  
$goto.= $_SERVER["REQUEST_URI"];

  
header("HTTP/1.1 301 Moved Permanently");
  
header("Location: http://".$goto);
  exit;
  
//echo "http://".$goto;
}
// HACK RLP 301 move to DUKE 

Here is the code for the archive
post directly above the hook code (search for hook)

PHP Code:

// HACK RLP 301 move to DUKE

$threadinfo fetch_threadinfo($t);

if (
$threadinfo) {
    
$forumid = ($threadinfo['forumid']);
}
else {
    
$foruminfo fetch_foruminfo($ffalse);
    
$forumid $foruminfo['forumid'];
}

if (
$forumid == "41" or $forumid == "25" or $forumid == "28" or $forumid == "30" or $forumid == "34" or $forumid == "38" or $forumid == "36" or $forumid == "37" or $forumid == "23" or $forumid == "29" or $forumid == "32" or $forumid == "27" or $forumid == "35" or $forumid == "39" or $forumid == "33" or $forumid == "89" or $forumid == "79" or $forumid == "90" or $forumid == "31") {

  
$goto ='www.your new server.de';
  
$goto.='/new extra subdir';
  
$goto.= $_SERVER["REQUEST_URI"];

  
header("HTTP/1.1 301 Moved Permanently");
  
header("Location: http://".$goto);
  exit;
  
// echo "http://".$goto;
}
// HACK RLP 301 move to DUKE 

Giving back to comunity I do not support anything, while I need myself support
BZ
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 05:34 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.06179 seconds
  • Memory Usage 2,194KB
  • 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
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)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