Page 1 of 1

Fixed old links

Posted: Wed Jan 04, 2006 1:26 pm
by Jorg
Hi Guys,

I added a php redirect script to the old wxWidgets forum location that will guide all old links to the new one;

Links like;

http://wxwidgets.solidsteel.nl/viewtopi ... 1f16d2c089

Won't end up in a 404 error, but present the new link now. I do know know how to parse the part behind the viewtopic.php?....... so when someone knows how I will adjust the script. It looks like this now;

Code: Select all

<?php

$url = "http://wxforum.shadonet.com";

header ("Location: $url");
?>
Which is the most PHP I ever written in my life ;-)
- Jorgen

Posted: Thu Jan 05, 2006 1:19 am
by lowjoel

Code: Select all

$_SERVER['QUERY_STRING'];
ima PHP guru 8) haha, nah, i just picked up experience from the last 1 year or so (ive coded blog systems CMSes photo galleries... even nearly a forum and a chat room, as well as a shoutbox :D)

Posted: Thu Jan 05, 2006 8:26 am
by Jorg
So what is the complete php code plus begin / end tag that I have to use? That will also fix the old links in the forum. I could make a DB query for that but hey since I still own the domain name, this will do for a while.

- Jorgen

Posted: Thu Jan 05, 2006 12:10 pm
by priyank_bolia

Code: Select all

<?php
	$newUrl = "http://wxforum.shadonet.com";
	$requestUrl = $HTTP_SERVER_VARS['REQUEST_URI'];
	header("Location: ".$newUrl.$requestUrl);
?>

Posted: Thu Jan 05, 2006 12:14 pm
by Jorg
Thanks I will implement this when I get home.

- Jorgen

Posted: Sat Jan 07, 2006 7:04 am
by lowjoel
HTTP_SERVER_VARS is deprecated, use $_SERVER.