Welcome, Guest. Please Login or Register.
July 07, 2025, 07:18:55 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  English User Help  |  English Help  |  moving forum..... help req. with post redirection. « previous next »
Pages: [1] Reply Ignore Print
Author Topic: moving forum..... help req. with post redirection.  (Read 407 times)
Overseer
Sr. Member
****
Posts: 455


moving forum..... help req. with post redirection.
« on: May 21, 2003, 08:36:32 AM »
Reply with quote

sometime soon i will be changing the domain my board is hosted on...

so my board being at say   www.current.com/index.php
would be on www.mynewsite.com/forum/index.php

my question is...

is there a script out there, or somethign i can do so that old post links (i will still have the old domain) will still work.. in that a script at the old location would redirect to the same post on the new location.

i think something like this was done on yabb se's own site here before sometime.
« Last Edit: May 21, 2003, 08:37:12 AM by Overseer » Logged

I learned that from the G's, a G is an Overseer, the Overseer sees.
More than you do 'cause he gets experienced - Snoop on Daz's OG

Supreme exalted, universal leader, Descendent of the kings and queens, the Overseer
The overlord, cream of the crop, creme de la creme - Gang Starr  Royalty
Shadow's Pawn
Support Team
YaBB God
*****
Posts: 597


ich soll nicht toten

ICQ - 8039201shadowpawn@hotmail.com WWW
Re:moving forum..... help req. with post redirection.
« Reply #1 on: May 21, 2003, 01:52:58 PM »
Reply with quote

Why don't you just move the database over to your new server?  Then you can just replace index.php on your old server with a redirect to the new one.
Logged

apologize \A*pol"o*gize\, v. i. - To lay the foundation for a future offense.
Overseer
Sr. Member
****
Posts: 455


Re:moving forum..... help req. with post redirection.
« Reply #2 on: May 21, 2003, 01:58:42 PM »
Reply with quote

uhhh thats what i meant all along....

people using the old URL for a post... say within an old post already on the board.. or linked from an external source...

someone going to say  www.current.com/index.php?board=9;action=display;threadid=34189

should get bounced to

www.mynewsite.com/forum/index.php?board=9;action=display;threadid=34189

notice i am moving the board into a subdirectory under the new URL too.. because there will be an entrance page below it.
Logged

I learned that from the G's, a G is an Overseer, the Overseer sees.
More than you do 'cause he gets experienced - Snoop on Daz's OG

Supreme exalted, universal leader, Descendent of the kings and queens, the Overseer
The overlord, cream of the crop, creme de la creme - Gang Starr  Royalty
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:moving forum..... help req. with post redirection.
« Reply #3 on: May 21, 2003, 02:12:19 PM »
Reply with quote

Yeah, it's easy.  Replace your index.php with something like:

<?phpheader('Location: ' . str_replace(' ', '%20', 'http://newurl/index.php?' . $UQERY_STRING));?>


-[Unknown]
Logged
Overseer
Sr. Member
****
Posts: 455


Re:moving forum..... help req. with post redirection.
« Reply #4 on: May 21, 2003, 02:20:15 PM »
Reply with quote

cool thx :)
Logged

I learned that from the G's, a G is an Overseer, the Overseer sees.
More than you do 'cause he gets experienced - Snoop on Daz's OG

Supreme exalted, universal leader, Descendent of the kings and queens, the Overseer
The overlord, cream of the crop, creme de la creme - Gang Starr  Royalty
Spaceman-Spiff
Mod Team
YaBB God
*****
Posts: 3689


My $txt[228]

Re:moving forum..... help req. with post redirection.
« Reply #5 on: May 21, 2003, 02:48:16 PM »
Reply with quote

i think its better to do it in .htaccess
Redirect permanent /forum http://www.newsite.com/forum

but your old site might not be up all the time
so, use something like this script to convert all old urls:
<?phpinclude "Settings.php";$dbcon = mysql_connect($db_server, $db_user, $db_passwd) or die(mysql_error());mysql_select_db($db_name) or die(mysql_error());$searchstring = "http://www.oldsite.com";$replacestring = "http://www.newsite.org";$query = "SELECT `ID_MSG`, `body`   FROM `md_messages`    WHERE 1 AND `body` LIKE '%$searchstring%';";echo '<b>' . $query . '</b><br /><br />';$request = mysql_query($query);while ($row = mysql_fetch_array($request)){   //echo $row['body'] . '<br /><hr /><br />';   $replacement = str_replace($searchstring, $replacestring, $row['body']);   $replacement = addslashes($replacement);   $idmsg = $row['ID_MSG'];   //echo '<div style="background-color: yellow;">' . $replacement . '</div><hr /><br />';   $request2 = mysql_query("UPDATE `md_messages` SET body='$replacement' WHERE ID_MSG=$idmsg LIMIT 1;");   echo "UPDATE `md_messages` SET body='$replacement' WHERE ID_MSG=$idmsg LIMIT 1;<br /><br />";}?>


make sure you do a backup before...
Logged

   My mods, ysePak, codes, tutorials
    Support question IMs = bad.
Overseer
Sr. Member
****
Posts: 455


Re:moving forum..... help req. with post redirection.
« Reply #6 on: May 21, 2003, 03:03:50 PM »
Reply with quote

old site will be up all the time.. the domains will be hosted under one account :)

i might do the dbase thing... i can actually fix some old links from when my board was under cgi-bin up using that too ;)
Logged

I learned that from the G's, a G is an Overseer, the Overseer sees.
More than you do 'cause he gets experienced - Snoop on Daz's OG

Supreme exalted, universal leader, Descendent of the kings and queens, the Overseer
The overlord, cream of the crop, creme de la creme - Gang Starr  Royalty
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  English User Help  |  English Help  |  moving forum..... help req. with post redirection. « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.034 seconds with 21 queries.